Ubuntu file permissions

ll

View file permissions

ll hello.txt

display

-rwxr-xr-x ...
  • The first drepresentative of a directory, -indicates that the file, lsymbolic link (soft link)
  • The second is whether the owner has read permission, which -means that there is no permission, the same below
  • The third is whether the owner has write permission
  • The fourth is whether the owner has execution permission
  • The fifth place is whether the same group has read permission
  • The sixth place is whether the same group has write permission
  • The seventh is whether the same group has execution authority
  • The eighth digit is whether the others have read permission
  • The ninth place is whether others have write permission
  • The tenth place is whether others have execution authority

chmod

Add read permission for the file to all users

sudo chmod a+r /usr/local/cuda/include/cudnn.h

chmod command

   [ugao] [[+-=][rwx]...] [,...]
   [ugoa]:档案调用权限分三级:档案拥有者,群组,其他
   u:档案拥有者
   g:群组
   o:其他
   a:全部
   [+-=]:
   +:增加权限;
   -:降低权限;
   =:唯一设定权限
   [rwx]:
   r:可读
   w:可写
   x:可执行

File permissions can be changed by digital method. rwx weights are 421 (binary)

sudo chmod 777 hello.txt

To the owner, the same group and others are rwx permissions

Guess you like

Origin blog.csdn.net/weixin_43742643/article/details/113487659