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

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>

主站蜘蛛池模板: 沾化县| 大新县| 永胜县| 隆尧县| 都江堰市| 嘉义县| 扶沟县| 监利县| 大化| 大安市| 离岛区| 武城县| 达尔| 青冈县| 福州市| 淮安市| 承德市| 陆川县| 西盟| 靖宇县| 天台县| 太原市| 金平| 延安市| 日土县| 元朗区| 长顺县| 花莲市| 社会| 石台县| 黔东| 高碑店市| 犍为县| 荥阳市| 盐山县| 淳安县| 阜新| 娄烦县| 徐水县| 邵武市| 保靖县|