chmod Introduction to Commands:
This command is used to Modify permissions for a file or group.
1 . Command format:
chmod MODE files, ... Change the permissions for files to mode
To modify a class of users or some class user rights:
U,g,o,a
chmod User category =mode file,...
Modify some or some bit permissions for a class of users:
U,g,o,a
chmod User category +|-mode file,...
chmod +x means that users, groups, and other people's permissions are directly added to execute permissions
chmod a+x equals chmod +x
Chmod ug+x represents increased execution rights for users and groups
chmod u+x indicates that only the owner is given additional execution privileges
2 . Command function:
Modify permissions for a file or directory category three users
3 . Command parameters:
-R recursively Change permissions for directories and their sub-files
--reference=/path/files files The permissions for the three categories of users
Change to the same file as the path specified.
4 . Command instance:
#chmod ' U=RW,G=RW ' 100.sh set 100.sh user and group permissions to RW permissions
#chmod ug=rw 100.sh equals chmod u=rw,g=r
[[email protected] test]# chmod ug-x 100.sh Canceling the execution rights of users and groups
[Email protected] test]# ls-l
-rw-rw-r-x. 1 donggen Root 273 September 19:49 100.sh
User and group execution permissions have been removed
[[email protected] test]# chmod u+x,g+w 100.sh Increase user execution rights and group write permissions
[Email protected] test]# ls-l
-rwxrw-r-x. 1 donggen Root 273 September 19:49 100.sh
The appropriate permissions for users and groups have been increased.
This article is from the "Learn Linux history" blog, please be sure to keep this source http://woyaoxuelinux.blog.51cto.com/5663865/1861878
Linux command: chmod