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-x
Indicates 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.
11
Indicates the number of linked files
LiuChenglong
Represents a user
staff
Represents the group in which the user resides
374B
Represents a file or folder size
3 25 09:33
Indicates last modified date
package
Represents 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 name
Represents 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 name
Indicates 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