CD
"function description":Linux CD commands can be said to beLinuxThe most basic command statements, and other command statements to be manipulated, are created using theCDon the command. So, learnLinuxthe Common command, first of all, must learnCDtips on how to use commands. its function is to switch the current directory toDirname (directory name).
"Syntax format": CD [ directory name ]
"Practice Actions":
Example one: Enter the system root directory
Command:
CD/
Output:
[[Email protected] ~]# CD/
Description: Enter the system root directory , after the above command is executed, take ls command to see that the current directory is already in the system root directory
Command:
CD: Or CD..//
Output :
/opt/soft
[[email protected] soft]# cd ..
[[email  PROTECTED] OPT]# CD&NBSP, ....
Span style= "font-family: ' The song body '; font-size:16px;" >/
Description
Enter the system root directory to use the CD. " always back, you can reach the root directory
Command:
Cd.. /.. //
/opt/soft
[[email  PROTECTED] SOFT]# CD&NBSP, .... /.. //
Span style= "font-family: ' The song body '; font-size:16px;" >/
Description: using the CD The command implements the parent directory into the parent directory of the current directory.
Example 2 : Using 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:
[Email protected] soft]# pwd
/opt/soft
[[Email protected] soft]# CD
[Email protected] ~]# pwd
/root
Command 2 :
CD ~
Output:
[[email protected] soft]# pwd
/opt/soft
[[email protected] soft]# cd ~
/root
Example 3 : Jump to the specified directory
Command:
Cd/opt/soft
Output:
[email protected] ~]# Cd/opt/soft
[email protected] soft]# pwd
/opt/soft
[email protected] soft]# CD jdk1.6.0_16/
[email protected] jdk1.6.0_16]# pwd
/opt/soft/jdk1.6.0_16
[email protected] jdk1.6.0_16]#
Description
jumps to the specified directory, starting at the root directory, with the directory name added / , the subdirectories in the current directory can be written directly by name
Example four: Return to the directory in which it was before entering this directory
Command:
CD-
Output:
[email protected] soft]# pwd
/opt/soft
[email protected] soft]# CD-
/root
[email protected] ~]# pwd
/root
[[email protected] ~]# CD-
/opt/soft
[email protected] soft]#
Example Five: Use the parameters of the previous command as CD parameters.
Command:
CD!$
Output:
cd -
/root
[[email protected] ~]# cd !$
Span style= "font-family: ' The song body '; font-size:16px;" >cd -
/opt/soft
[[email protected] soft]#
This article is from the "Cornerboy" blog, make sure to keep this source http://cornerboy.blog.51cto.com/10012663/1651567
Linux Small white-basic command-CD