CD [-l |-p] [directory]
Switch directories
(1). Options
-L If the destination directory you want to switch to is a symbolic connection, switch directly to the destination directory to which the symbolic connection is directed
-P If the destination directory to be toggled is a symbolic connection, switch directly to the directory that the character connection name represents, not the destination directory to which the symbolic connection points
There are also some special symbols
. Current directory
.. Parent Directory
-Previous working directory
~ User home directory, which is the directory specified by the home variable, such as the root user's home directory is/root
!$ Use the parameters of the previous command as CD parameters
(2). Example
[[Email protected] Desktop]# pwd//view current directory/root/desktop [[email protected] Desktop]# cd/home//absolute path [[email protected] home]# pwd/home[[e Mail protected] home]# CD//no parameters, default go to home variable specified directory, approximately equal to ~[[email protected] ~]# Pwd/root[[email protected] ~]# CD-//back to previous directory /home[[email protected] home]# Pwd/home[[email protected] home]# CD!$//Repeat last parameter CD-/root[[email protected] ~]# pwd/root[ [Email protected] ~]# CD. Return to parent directory [[email protected]/]# Pwd/[[email protected]/]# CD./var/spool/mail///relative path [[email protected] mail]# PWD/VAR/SP Ool/mail
CD of Linux commands