Linux Command-based chmod usage and linuxchmod usage

Source: Internet
Author: User

Linux Command-based chmod usage and linuxchmod usage

Chmod: Change permissions

Method 1:Use a number to change the permissions of a file or path

The permission score is as follows:

R: 4

W: 2

X: 1

Identity includes:

User: u, group: g, other: o

For example,-rwxrwx --- indicates that the file permissions are:

User: 4 + 2 + 1 = 7

Group: 4 + 2 + 1 = 7

Other: 0 + 0 + 0 = 0

Note: In this case, drwxrwx ---, the first letter is d, indicating a path, with the same permissions as above

Change the File Permission to-rwxr-xr-x.

Chmod 755 file

NOTE: If it is a directory, the code is: chmod 755 dir; if all the contents are 755, then: chmod 755-R dir

Method 2:Use the symbol type to change File Permissions

User: u + (ADD) r

Group: g-(remove) w files or directories

Other: o = (SET) x

All:

Chmod a + x file adds execution permissions to u, g, and o

Chmod u-w file removes write permission from u

You can also use this method: chmod u = rwx, go = rx file is equivalent to chmod 755 file



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.