1. Command format:
cd [ directory name ]
2. Command function:
Toggle current directory to DirnamE
3. Common examples
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 1 [email protected] soft]# pwd 2 2 /opt/soft33 [[email protected] soft]# CD . 4 4 [[email protected] opt]# CD. // 5 5 [[email protected]/]# pwd66
Description
Enter the system root directory to use the CD. " always back, you can reach the root directory
Command:
Cd.. /.. //
Output:
1 [email protected] soft]# pwd 2 /opt/soft3//4 [[email protected]/]# pwd5 / 6
Description: Use the CD command to implement the parent directory into the parent directory of the current directory.
Example 2: Using the cd command to enter the current user home directory
The "Current User home Directory" and "system root" are two different concepts. There are two methods to enter the current user home directory.
Command 1:
Cd
Output:
1 [[Email protected] soft]# pwd2/opt/soft3 [[email protected] soft]# CD4 [[email protected] ~]# Pwd5/root
Command 2:
CD ~
Output:
Example 3: Jump to a specified directory
Command:
Cd/opt/soft
Output:
Description
Jump to the specified directory, starting from the root directory, the directory name plus /, The current directory in the subdirectory directly write the name can be
Example four: return to the directory in which it was before entering this directory
Command:
CD-
Output:
Example five: use the parameters of the previous command as CD parameters .
Command:
CD!$
Output:
One Linux command per day (2): cd command