Linux权限相关介绍

上图中:

u 代表 本用户

g 代表 本用户所在的组

o 代表 other 其他用户

a 代表 all  所有用户 

chmod 代表 change mode(修改存取的模式)

Linux权限相关介绍

如上图 chmod o+w myfile.txt    代表把other用户的权限 增加(+)一个w的权限(w代表write 写)

 

Linux权限相关介绍

如上图 chmod o-w myfile.txt    代表把other用户的权限 减去(-)一个w的权限(w代表write 写)

 

Linux权限相关介绍

如上图 chmod a+x myfile.txt    代表把所有(all)用户的权限 加上(+)一个x(可执行)的权限(w代表write 写)

 

Linux权限相关介绍

 Linux权限中的 :r w x 分别可以用1 ,0 表述(1是允许   0是禁止)

r w x 分别用1,0 替代后,生成对应的二进制,然后转化为十进制 

Linux权限相关介绍

如使用命令:chmod 754 myfile.txt

表示把第一组的 r w x 设置为 1 1 1 (换成十进制就是7)

           第二组的 r w x 设置为1 0 1 (换成十进制就是5)

           第三组的 r w x 设置为1 0 0 (换成十进制就是4)

 

Linux权限相关介绍

 

Linux权限相关介绍

同时修改文件(文件夹)的所有者和所有者所在的组  递归修改加参数-R

chown -R test.test testDir

等同于chown -R test:test testDir   (冒号 : 跟 . 等同)

Linux权限相关介绍

如上图 ,从上到下 红色矩形框代表

1. 修改myfile.txt文件所属用户为ywb

2.修改myfile.txt文件所属用户组为ywb

3.同时修改myfile.txt文件的所属用户和所属用户组为test

4.创建文件夹testDir

 

 

Linux权限相关介绍

如上图,红色矩形框,新建多个文件用touch  然后文件用空格分开 ,代表创建了file1 file2 file3   共计3个文件

相关文章:

  • 2021-10-14
  • 2022-01-01
  • 2021-06-24
  • 2021-11-06
  • 2021-09-06
  • 2021-11-20
  • 2022-02-05
猜你喜欢
  • 2019-09-08
  • 2022-12-23
  • 2021-07-16
  • 2021-10-23
  • 2022-12-23
  • 2021-12-09
  • 2021-06-18
相关资源
相似解决方案