Linux file Permissions

Source: Internet
Author: User

drwxr-xr-x 11 liuchenglong staff 374B 3 25 09:33 package

Linux file management and Windows are very different, many details do not learn are difficult to understand, but in fact, they are paper tigers, as long as a little learning can be mastered, today learned is Linux file permissions, record for a rainy day.

Speaking of permissions, you have to say the concept of user groups, Linux is a multi-user operating system, under Linux, each user belongs to a group, non-current users belong to other groups, then a file corresponds to three kinds of permissions-the owner, the group and other groups.

Use ls -ahl to view the details of a file under the current path. which
drwxr-xr-xIndicates that different users can manipulate this file, folder, or link
The first character represents a file (-), a table of contents (d), or a link (l)
Each of the following three groups represents the current user, the current group, and the other group.
R: Read
W: Write
X: Execute
In addition to using RWX to express reading, writing and execution, you can also use numbers to express, R=4,w=2,x=1.

11Indicates the number of linked files

LiuChenglongRepresents a user

staffRepresents the group in which the user resides

374BRepresents a file or folder size

3 25 09:33Indicates last modified date

packageRepresents the name of a file or folder

Modify Permissions Command

Since there are file permissions, there is a natural command to modify the permissions of the file. Use commands in Linux chmod to modify the permissions of a file or folder.
As mentioned above, reading, writing and execution can be represented by numbers, so the most convenient way to give permission is to use the sum of numbers to represent permissions.
chmod 766 nameRepresents the permissions granted to a file or folder named Name rwxrw-rw-

Of course there are complex usages, such as using the U-G o-A to represent the current user, the current group, other groups, and all users, using +-= for join permissions, to go out of permissions and to set permissions.
chmod u=rwx,g+w,o-w nameIndicates that the current user is given read, write, and execute permissions, adds write permissions for the current group user, and removes write permissions for other group users.

Linux 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.