官术网_书友最值得收藏!

The chmod command

To change the permissions of a file, you need to use the chmod command, chmod <letters> <file or directory>. You can also use an octal format instead of letters, chmod <octal format> <file or directory>. To convert the permission from the letters format to the octal format, you need to convert every permission into a value:

Now, let's take an example and see how to use the chmod command with the octal format in an easy way. Let's suppose that we need to give the user the permission to read and write, the group only to read, and others only to execute. Then, the octal format will be 641, because:

  • User: Read + Write = 6
  • Group: Read = 4
  • Other: Execute = 1

The final command will be: chmod 641 <file>

主站蜘蛛池模板: 西宁市| 遵化市| 德安县| 胶南市| 四川省| 洛浦县| 嘉义县| 左贡县| 白玉县| 湘潭市| 梁山县| 建阳市| 社旗县| 通许县| 南京市| 清苑县| 雷波县| 嘉兴市| 乌拉特中旗| 老河口市| 光泽县| 扶风县| 青川县| 齐河县| 三原县| 武川县| 农安县| 志丹县| 长武县| 平陆县| 开平市| 宜宾县| 施甸县| 游戏| 江都市| 广安市| 永州市| 麻江县| 乌兰县| 五大连池市| 齐河县|