Linux View and modify directory file permissions (commands) _linux

Source: Internet
Author: User
Tags chmod file permissions

View and modify directory file permissions under Linux

There are several folders under my server

You can also use Ls-l to view the permissions for these several files.

Look at the assets file, which has a total of 10 digits, of which:
The front one - represents the type
The middle three rwx represent the permissions owned by the owner (user)
then the three rwx represent the permissions that the group has
the last three rwx represent the rights that other people (other) have.

R indicates that the file can be read (read)
W indicates that the file can be written (write)
x indicates that the file can be executed (if it is a program)
- indicates that the appropriate permissions have not been granted

Next is the file Modification command, here I use chmod this command.

In the terminal input:

chmod o W xxx.xxx

To give other people permission to write xxx.xxx this file

chmod GO-RW xxx.xxx

Indicates deletion of Read and write permissions for groups and other people in xxx.xxx

which

U on behalf of owner (user)
G represents the group in which the owner is located
O on behalf of others, but not u and g (Other)
A represents all the people, including U,g and O.
R indicates that the file can be read (read)
W indicates that the file can be written (write)
x indicates that the file can be executed (if it is a program)

Where: Rwx can also use numbers to replace

R ———— 4
W ——— –2
X ———— 1
-———— 0

Let's go:

"" means adding permissions
-Indicates delete permission
= means to make it a unique permission

When everyone is aware of the above, then some of our common permissions are easy to understand:

-RW ——-(600) Only the owner has read and write permission
-rw-r–r– (644) Only the owner has read and write permission, the group and others only Read permission
-rwx--(700) Only the owner has the right to read, write, execute
-rwxr-xr-x (755) Only the owner has the right to read, write, execute, group and others only read and execute
-rwx–x–x (711) Only the owner has permission to read, write, execute, group and others only execute
-rw-rw-rw-(666) Everyone has access to read and write
-RWXRWXRWX (777) Everyone has access to read and write and execute

Thank you for reading, I hope to help you, thank you for your support for this site!

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.