介绍

  1. Linux文件和目录权限解读
    • image.png
  2. 如何设置Linxu文件和目录的权限
    • image.png
  3. 字符表示法等等
    • image.png

命令

  1. ls -l:查看所在目录所有文件的权限
  2. chmod u=r file:把file文件的当前(用户user)的权限赋值为可写模式
  3. chmod g=wrx file:把file文件的当前(组gruop)的权限赋值为可写,可读,可执行模式
  4. chmod g-x file:把file文件的当前(组group)的权限减去可执行模式
  5. chmod o+w file:把file文件的当前(所有人other)的权限加上可写模式
  6. chmod a-x file:把file文件的当前(用户user),(组group),(所有人other)的权限减去写入模式
  7. chmod 777 file:把file文件的当前(用户user),(组group),(所有人other)的权限设为可读可写可执行模式
  8. chmod -R 777 file:把file目录下所有的文件以及文件夹通过递归方式对的当前(用户user),(组group),(所有人other)的权限设为可读可写可执行模式

遇到的问题:
  1. 如果执行修改权限出现 Operation not permitted 请在命令前面加sudo chmod -R 777 file