LINUX from zero to learn the command cd

cd command

1, cd Linux is one of the most commonly used commands.

2, the command format

cd relative or absolute path or special symbols

3, command function

Change directory

4, command usage

① when no parameters, switch to the default user's home directory

② bonding absolute or relative path, switching to the corresponding directory

③ special symbol then proceeds to the corresponding directory represented

~ Into the home directory;

- Returns the directory where before entering the directory;

.. return to parent directory;

../ .. Return two directories;

! $ Parameters on the command cd is used as a parameter.

5, an example of command

Example 1: Switch to the user's home directory

[root@localhost tmp]# cd

[root@localhost ~]#

 

Example 2: absolute path into a different directory

 

[root@localhost ~]# cd /tmp/TEST/

[root@localhost TEST]#

 

Example 3: the relative path into the other directories

[root@localhost TEST]# cd ../1d/

[root@localhost 1d]#

 

Example 4: ~ into the home directory

[root@localhost 1d]# cd ~

[root@localhost ~]#

 

Example 5: Returns the directory where before entering this directory

[root@localhost ~]# cd -

/tmp/1d

[root@localhost 1d]#

 

Example 6: return to parent directory

[root@localhost 1d]# cd ..

[root@localhost tmp]#

 

Example 7: The parameters command is used as a parameter cd

[root@localhost tmp]# cd !$

cd ..

[root@localhost /]#

Guess you like

Origin www.cnblogs.com/baozouxiaonengmao/p/11023500.html