Linux View and modify file permissions

Source: Internet
Author: User

1. View: ls-l [filename]

2. Modifications

2-1. Writing method chmod [who] [+][-][=] [mode]

who note: U represents the owner of the file, G indicates the group to which the file belongs, o means others, and a means everyone

Compliance Description: + means add permission,-Indicates reduced permissions, = means overwrite original permissions

Mode Description: R for Read permission, W for write permission, x for executable permission

Example: chmod g+w temp.bak for adding write permissions to all groups for Temp.bak files

2-2. Digital Law

Numerical Description:-Indicates no permission, r corresponds to 4,w corresponding to 2,x corresponds to 1, memory; rwx corresponds to 421

Example: 765 corresponds to-rwxrw-r-x, the first-indicates that the file type is a file, independent of permissions, the latter three groups: 7 corresponds to rwx,6 corresponding rw-,5 corresponding r-x

Execute chmod 765 Temp.bak to change Temp.bak file permissions to-rwxrw-r-x

3. Supplement: The directory must have executable permissions to view or access the directory.

Linux View and modify file permissions

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.