Linux file types and how to view, modify file read and Write permissions

Source: Internet
Author: User

Now use the Ls-l command to view a list of files in the details format, and you will see the following:
Total 5
Drwxr-x---4 user group 4096 Mar 00:37 filename
Drwxr-xr-x user group 4096 Mar 10 20:16 file name
-RW-------1 User group 524 Mar 00:40 A
-rw-r--r--1 user Group, June, B
A total of seven columns of information are displayed, from left to right in turn:PermissionsNumber of files,Attribution to users,Attribution Group,File size,Creation date,File name
One of the special things to note is the first column:
Drwxr-xr-x
A total of 10 locations, can be divided into 4 groups:
D Rwx r-x r-x
The first group has only one character:
D folder
-Normal file
L Link
B-Block device files
C-character device file.

The remaining 3 groups are attribution users, attribution groups, other users or groups of permissions for the file. We look at the format of it
rwx rwx rwx
R Readable
W Writable
X executable

Now it's time to talk about modifying file permissions.
In terminal input:chmod o+w xxx.xxx
Give other people permission to write xxx.xxx this file
chmod GO-RW xxx.xxx
Represents the deletion of read and write permissions for groups and others in xxx.xxx
which
U on behalf of owner (user)
G represents the group where the owner resides
O stands for others, but not u and g (other).
A represents all people, including U,g and O.

R indicates that a 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 be replaced by numbers
R------------4
W-----------2
X------------1
-------------0

Let's go:
+ means add permission
-Indicates delete permission
= indicates a permission to make it unique

When we all understand the above, then we often have some of the following permissions are easy to understand:
-RW-------(600) Only the owner has read and write permissions
-rw-r--r--(644) Only the owner has read and write permissions, and the group and other people only have Read permissions
-RWX------(700) Only the owner has read, write, execute permissions
-rwxr-xr-x (755) Only the owner has read, write, execute permissions, groups and other people only read and Execute permissions
-rwx--x--x (711) Only the owner has read, write, execute permissions, groups and other people only execute the permissions
-rw-rw-rw-(666) Everyone has access to read and write
-rwxrwxrwx (777) Everyone has access to read and write and execute

Linux file types and how to view, modify file read and Write permissions

Related Article

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.