This content comes from bird's private cuisine
1. Directory-related Operations
1.1 Special Directories
- . Represents this Layer directory
- .. Represents a previous level directory
- -Represents a previous working directory
- ~ Represents the home folder where the current user identity resides
- ~account represents the account of the user's home folder
1.2 Basic operations of the Directory
- CD: Switch directories
- PWD: Show current directory
- mkdir: Creating a Directory
- RMDIR: Deleting a directory
2. File related Operations
- Create a new file touch (you can also modify the file time)
- Copy CP: Usually the source file has different permissions to the destination file, the owner of the destination file is usually the command operator itself, and the file's properties are related to the default property umask
- Delete RM
- Moving MV
- View text file contents cat,more,less (common); View non-plain text file OD (especially for binary files)
- Which look for execution files (look in the path variable); Whereis and locate look for files (in the database, may not find the newly created file); Find files (slow search on hard disk)
3. File Default Properties
The user creates the file, the default does not have the executable permission namely-rw-rw-rw-; The user creates the directory file, the default all permissions are open namely drwxrwxrwx;
The files and directories that are actually created also subtract the permissions default values set by Umask, for example: Umask value is 022
When creating a new file: (-rw-rw-rw-)-(----w--w-) ==>-rw-r--r--
The new directory is: (DRWXRWXRWX)-(----w--w-) ==>drwxr-xr-x
Linux Learning Path-linux file and directory management