Linux command: chmod

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.