Hands-On System Programming with Go
上QQ阅读APP看书,第一时间看更新

Changing permission

The chmod command makes it possible to change permission on a file or directory. This can be used to override current permissions or to modify them:

  • In order to replace permissions, the chmod xxx file command must be issued. xxx can be the three octal values representing the permission for the respective tiers or a string that specifies permissions, such as u=rwx, g=rx, or  o=r.
  • To add or remove one or more permissions, chmod +x file or chmod -x file can be used.

For more information, use the chmod command with the help flag (chmod --help).