1. File attributes
[Email protected] ~]#ls-Altotal136Dr-xr-x---.5Root root4096Mar A Ten: *. Dr-xr-xr-x. -Root root4096Feb A the: + ..-RW-------.1Root root1138May in -anaconda-ks.cfg-RW-------.1Root root34728May - -: -. Bash_history-rw-r--r--.1Root root -May - the. Bash_logout-rw-r--r--.1Root root176May - the. Bash_profile-rw-r--r--.1Root root theDecTen -. BASHRC-rw-r--r--.1Root root -Sep at 2004. CSHRCDRWXR-xr-x.2Root root4096Mar the -:TenEcafedemo-rw-r--r--.1Root root26090May in - Install. Log-rw-r--r--.1Root root7345May in - Install. Log.syslog-RW-------.1Root root -Mar - +:Geneva. Lesshst
Where: Install.log's file permissions are:-rw-r--r--
The first character represents the type of the file (such as a directory, file, or linked file, and so on):
When [d] is the directory, for example, the row with the table file named ". GConf";
When [-] is the file, for example, the previous table is named "Install.log" the line;
If [l] is indicated as a link file (link file);
If [b] is indicated as the device file inside the storage interface device (can be random access device);
If [C] is indicated as a serial port device in the appliance file, such as a keyboard, mouse (disposable reading device)
A combination of three parameters in the next character, grouped by three, and all "rwx"
[R]: indicates readable
[W]: Indicates writable
[x]: Indicates an executable
The first group is "file owner's permission", take "Install.log" that file as an example, the owner of the file can read and write, but not executable;
The second group is "permissions for the same user group";
The third group is "Other permissions that are not part of this user group."
Read permissions for the directory: You can view information about the directory itself (ll-d).
Write permissions for the directory: You can create and delete files under the directory.
Execute permissions for the directory: You can get a list of files in the directory, and enter the directory. To read and modify files that exist in the directory, you must enter the directory, so you must have execute permissions on the directory.
2. modifying file properties and Permissions
CHGRP: Changing the user group to which the file belongs
Chown: Changing the file owner
chmod: Changing file permissions
Chown can also modify both the file owner and the user group that the file belongs to, such as:
Change the owner and user of the Install.log
Chown install. log
Chown can also simply modify the owning user group, for example:
Chown install. log
Chmod can represent three kinds of permissions through U, G, O, for example:
chmod u=rwx, Go=rx . BASHRC
You can also write/remove write permissions for each file via a+x, or a-x
chmod a+x filename
Linux file properties