iii. default permissions and hidden permissions for files and directories
1. umask: File default Permissions
File default permission is "-rw-rw-rw-" directory default permission "DRWXRWXRWX"
2, Chattr, lsattr: File Hidden properties
chattr [+-=] [asacdistu] File or directory
+: Add to touch a special parameter-: Delete a special parameter =: only the following parameters
A: This file can only add data, cannot delete or modify the data, only root can set this property;
I: This file can not be deleted, renamed, set the connection can not write or add data, for system security is very helpful, only the root can set this property.
Eg:chattr +i test1 Settings test1 cannot delete input rm test1 cannot be deleted
This command is more important, especially in the system's data security. The chattr command can only take effect on the Ext2/ext3 file system.
lsattr [-adr] file or directory: Show file-Hidden properties
3. File: View the files of type file
iv. query for command and file
1, which: query for script file name (path of command) which [-a] command
2, whereis: file name lookup Whereis [-BMSU] file or Directory Name
-B: Find only binary format files-m: Only files under the manual path of the description file
-S: Only source files are found-u: except for the above special files
Locate: File name lookup (enter the keyword) locate [-ir] Keyw Ord
-I: Ignore case-R: can be followed by the display of regular Expressions
3, find: File name finds find [path] [iption] [action]
A, time-related parameters (-atime,-ctime,-mtime)
-mtime n = n is a number, a file that has been changed within one day of the nth day
-mtime N. A (not included) file that was changed
-mtime N. N (contained) changed files
B, user, or user group parameters
-uid N # is a number, corresponding to the account ID
-gid n = = number, corresponding to the ID of the user group name
-user name:name the user account name Eg:find/home-user
-group Name:na Me for the user group name
-nouser: Look for people who do not exist/etc/passwd file owner
-nogroup: All user groups looking for files do not exist in/etc/group files
C, file permissions and name-related parameters
-name FileName: Find file named filename
-perm mode: Find files with file permissions of mode
v. Relationship between Authority and command (important)
1. Allow users to enter a directory to become a "working directory" basic Permissions
Permissions required by the directory: User must have at least X permission to change directories
2. Allow users to read the basic permissions of a file in a directory
Permissions required by the directory: User must have at least X permission to change directories
Permissions required by the file: User must have at least R permission to the file
3, let the user can modify the basic permissions of a file
Permissions required by the directory: User must have at least X permission to change directories
Permissions required for files: User must have at least R, W permissions on the file
4. Allow users to create a file with basic permissions
Permissions required for directory: User must have at least W, x permission to change directories
5. Allow the user to enter a directory and execute the basic permissions of a command under that directory
Permissions required by the directory: User must have at least X permission to change directories
Permissions required by the file: User must have at least X permissions to the file
Brother Bird's directory management of Linux private dishes