Comparison of special directories:
. Represents this Layer directory
.. Represents a previous level directory
-Represents a previous working directory
~ Represents the home folder where the current user's identity resides
~account represents the home folder where the account user resides
1. Directory-related Operations
CD Switch Directory
CD [Relative path or absolute path]
CD special directory//switch to special directory
CD//does not add any path, also represents the meaning of returning to their home folder
PWD Displays the current directory
Pwd-p display the current path instead of using a connected path
mkdir New Directory
mkdir [-MP] Directory name
-m configuration file directory permissions
-P directly creates the desired directory recursively.
Example
#mkdir-P Test1/test2/test3 Recursive creation of TEST1,TEST2,TEST3 directory
RmDir Delete "Empty" directory, note that only empty directory can be deleted
-P directly deletes the desired directory recursively
2. File and Directory Management
View files and directories: LS
ls [-alt] directory name
-A All files are listed together with hidden files to
-L lists long strings of data, including file attributes and permissions
-T Sort by time
Copy, delete, move: CP,RM,MV
CP [-AIFRP] source file destination file
-A is equivalent to all attributes and permissions copied together
-F Forced replication
-I if the target file already exists, ask for the action before overwriting
-P along with the properties of the file copy the past
-R Recursive Continuous replication
RM [-rfi] File or directory
-F Mandatory
-I interactive mode, asking the user whether to operate
-R Recursive Delete
MV [-FIU] source destination
-F forced Override
-I interactive mode
-U if the target file exists and the source is newer
Basic Linux file and directory operations