I. Related operations of the directory
Comparison of special directories:
. Represents this layer directory: Represents the upper level directory
-Represents the previous working directory ~ represents the current user's Living folder
~accout represents the user's home folder (account is a name)
1. CD: Switch directory: CD directory name
2. PWD: Show current directory: PWD
3. mkdir: Create a new directory: mkdir [-mp] Directory name
-M: Configuration file permissions mkdir-m 744 test
-P: Create a multilevel directory eg: enter command mkdir-p TEST1/TEST2/TEST3
4. RmDir: Delete a directory: RmDir [-p] Directory name
-P: Create a multilevel directory eg: enter command rmdir-p TEST1/TEST2/TEST3
5. CP: Copy: CP [-ADFILPRSU] source file destination file
-A: equivalent to-PDR (common)
-I: If the target file exists, the overwrite will ask the operation (Common)
-R: Recursive continuous Replication for directory replication behavior (Common)
6. RM: Delete files or directories: RM [-fir] File or directory
7, MV: Moving files or directories: MV [-fir] source file destination file
8. Get path filename and directory name
A, file name: input command: basename path
B, Directory: input command: dirname path
Second, the contents of the document inspection
1. Cat: Starting from the first line displays the contents of the file: Cat [-abentv] File
-N: Print the travel number, along with the blank line will also have line number
-B: Print travel number, blank line does not print
2. TAC: Starting from the last line, just the opposite of the cat command: TAC
3, NL: Display time, by the way output line number: NL [-BNW] File
4, more: one page page content: more files
5, Less: page by page, similar to more, you can page forward: less file
6, head: Data selection, select the first few lines (default display 10 lines): Head [-N number] File
-N followed by a number, indicating the meaning of a few lines
7, Tail: Data selection, select a few lines (default display 10 lines): Tail [-N number] File
8, OD: Read the contents of the file in binary way: od [-t type] File
-T followed by various types: A for default, C for ASCLL characters, d[size] decimal, f[size] floating point, o[size] octal, x[size] Hex
9. Touch: Modify the file time or create a new file: Touch [-ACDMT] File
-A: Modify access time only;
-C: Only modify the file time, if the file does not exist do not create a new file;
-D: the date after which the modification was received
-M: Modify Mtime only;
-T: Subsequent modification time in the format [YYMMDDHHMM]
Note: The touch command is used primarily to create an empty file or to modify a file date to the current date.
Brother Bird's Linux private cuisine Linux file permissions and directory management (a)