The linux cd command is one of the two commands with the highest usage in Linux. The other is ls, of course ), I have never known the tips for seeing a linux cd command two days ago.
Cd-# Go Back To The Last directory. I didn't know this technique. It seems to be useful and I have omitted a lot of input.
Cd! $ # Input the parameters of the previous command.
Cd # return to the home directory
Cd ~ # Return to the home directory
The following is a coherent example:
Reference
Ocean @ flower-laptop :~ $ Pwd # view the current directory path
/Home/ocean
Ocean @ flower-laptop :~ $ Sudo tar xf wordpress.tar.gz-C/opt/lampp/htdocs/wordpress # decompress the compressed package to the/opt/lampp/htdocs/wordpress directory
Ocean @ flower-laptop :~ $ Cd! $ # Run linux cd! $ Use the last parameter of the previous command as the input, that is,/opt/lampp/htdocs/wordpress
Cd/opt/lampp/htdocs/wordpress
Ocean @ flower-laptop:/opt/lampp/htdocs/wordpress $ pwd # view the current directory path
/Opt/lampp/htdocs/wordpress
Ocean @ flower-laptop:/opt/lampp/htdocs/wordpress $ cd # Run the linux cd command to return to the home directory
Ocean @ flower-laptop :~ $ Pwd # view the current directory path
/Home/ocean
Ocean @ flower-laptop :~ $ Cd-# run linux cd-and return to the last directory.
/Opt/lampp/htdocs/wordpress
Ocean @ flower-laptop:/opt/lampp/htdocs/wordpress $ pwd # view the current directory path
/Opt/lampp/htdocs/wordpress
In this way, you can see how to use the linux cd command.
Xen Virtual Machine practice: How to Create a snapshot using Linux commands
Ten Linux commands you may have never used
Linux cd commands