Let's look at an example:
[Email protected] opt]#Ls-al
The Ls-al command is to list all files in the directory, including hidden files. The first character of the hidden file's file name is '. '
-rw-r--r--1 root root bayi 08-02 14:54 gtkrc-1.2-gnome2
-RW-------1 rootroot 189 08-02 14:54iceauthority
-RW-------1 rootroot 08-0510:02. Lesshst
drwx------3 root root 409608-02 14:54. metacity
Drwxr-xr-x 3 root root 409608-02 14:54 Nautilus
The permission attribute list is 10 characters:
The first character indicates the file type, D is the directory-for normal file L for connection b for the storage interface device C for keyboard and mouse input device
2, 3, 4 characters represent owner permissions, 5, 6, 7 characters represent owner-group user Rights, 8, 9, 10 for other user rights
The second character represents the owner Read permission, or R if there is permission, or-
The third character represents the owner write permission, or W if there is permission, or-
The fourth character represents the owner execution permission, or X if there is a permission, or-
The fifth character indicates that the owner is in the same group as the user Read permission, if the permission is R, no permission is-
The sixth character indicates that the owner is the same as the group user write permission, if the permission is W, no permission is-
The seventh character indicates that the owner performs the permissions with the group user, and if the permission is x, no permission is-
The eighth character represents other non-identical read permissions, and if there is a permission R, no permission is-
The nineth character represents the other non-identical write permissions, if the permission is W, no permission is-
The tenth character represents the other non-identical group execution permissions, if the permission is x and no permission is-
To modify file access Permissions command:
[Email protected] opt]#chmod [-rv]0777 filename
-V: Show details of permission changes
- R: The same permissions change for all files in the current directory and subdirectories (i.e., recursively changing one by one)
[[Email protected]opt]#chmodABC file name
Each of the a,b,c is a number that represents the permissions of the user, Group, and other respectively.
R=4,w=2,x=1
To rwx the attribute then 4+2+1=7;
To rw-the attribute then 4+2=6;
to r-x the property, 4+1=5.
< Span style= "color: #0000ff; font-size:16px; padding:0px; margin:0px; " >
Linux Modify file Permissions command