I. Significance of the existence of file permissions
setting permissions on a file is one of the most basic security settings for Linux, because Linux is a multi-tasking operating system, and it is likely that many different people are using the same host, in order for the security file permission mechanism to be required, it ensure that the file can be used by the user to do the appropriate action, but also ensure that the file will not be unavailable to users to operate.
Two. View of file permissions
The commands used are:
Ls-l file or ll file
Ls-ld dir or ll-d dir # # ll=ls-l # #
Three. Read the file permissions
From a line of string examples, specifically analyze what the permissions information contains:
D |rwxr-xr-x| 2 | Root | Root | 6 | Jul 22 02:48 | /mnt
[1] [2] [3] [4] [5] [6] [7] [8]
[1] Type of file
-# #空文件, or text
D # #目录
L # #软链接 is similar to a shortcut, opening this file actually opens the source file
S # #socket sockets, the program is closed, the socket is the interface of the program's external interaction
B # #block block device after external device is plugged in
C # #字符设备
[2] Permissions for files
Rwx|r-x|r-x
1 2 3
1.[u] What the file owner can do with the file
2.[G] File What can all groups do with files
3.[o] What other people can do with files
[3] File: Number of hard links to files (the number of times the contents of the file have been recorded by the system)
To directory: The number of subdirectories in a directory
[4] owner of the file
[5] All groups of files
[6] To file: File size
To directory: the size of the subdirectory file metadata (matedate); The metadata is a property of the file # # #每个字符是一个字节, file name one character is a byte # # #
[7] time when the contents of the file were modified
[8] Name of the file
Linux from getting started to mastering the permissions of files in--linux