7.linux File and directory management
I. Paths and directories
1.1 Relative path and absolute path:
Relative path: Relative to the current directory's path
Absolute path: The path relative to/
1.2 Show current path and toggle current path
PWD Displays the absolute path of the current file
Cd. , .. ,-, ~ command use, CD/,cd/opt
1.3 Creating directories, renaming directories, deleting directories
mkdir Create directory, mkdir hzc0902, Mkdir–p hzc0902/test1/test2
MV Rename path mv hzc0902 hzc090201
RmDir Delete directory rmdir hzc0902, delete only non-empty directories
1.4 Environment Variables: View environment variables: Echo $PATH, add environment variable: path= "$PATH":/root
Delete environment variable I don't know yet.
Ii. Document and Directory Management
1.1 Viewing files and directories: LS
1.2 Copy, delete and move: CP, RM, MV
Third, data content access: Cat, TAC, NL, more, less, head, tail, OD, file creation: Touch
Iv. default permissions and hidden permissions for files and directories
- Umask Show Default Create Permissions
- File View Files Type
Five, command and file query
- which
- Whereis, locate, find
7.linux File and directory management