Directive: CD
Switch the current directory to the target directory
Syntax: # CD [directory name]
Usage examples
1. Enter the/home/doiido directory
# Cd/home/doiido
View your current directory
# pwd
2. Enter the Doiido directory in the current year directory
# CD Doiido
In fact, the above two examples involve relative paths and absolute path problems, see relative and absolute paths in detail
The CD command uses a few tricks:
# CD into the user's home directory
# cd ~ Go to User home directory
# CD-Returns the directory where it was before entering this directory
# CD: Returns the parent directory, if the current directory is/directory, then the/directory after execution
# CD!$ Use the parameters of the previous command as CD parameters
This article from "Doiido" blog, reproduced please contact the author!
Linux Instructions CD instruction detailed