1.
Example two: Listing the details of all directories in the current directory that begin with "T", you can use the following command:
Command: Ls-l t*
Example six: Calculating the number of files and directories in the current directory
Command:
Ls-l * |grep "^-" |wc-l---Number of files
Ls-l * |grep "^d" |wc-l---directory number
2.
3.1 Example One: Enter the system root directory
Command:
CD/
Output:
[[Email protected] ~]# CD/
Note: Enter the system root directory, the above command after the execution of the LS command to see, the current directory has been to the system root directory
Command:
Cd.. or CD. //
Output :
1 [[Email protected] soft]# pwd
2/opt/soft
3 [[Email protected] soft]# CD.
4 [[Email protected] opt]# CD. //
5 [[email protected]/]# pwd
6/
Example four: Return to the directory in which it was before entering this directory
Command:
CD-
Example 2: Creating multiple directories recursively
Command:
Mkdir-p test2/test22
Example 3: create a directory with permissions of 777
Command:
Mkdir-m 777 Test3
Linux Command Knowledge points