ArticleDirectory
- Parameters
- Option
- Example
- Tips
Switch to another working directory
CD[Options] [Directory]
Parameters
DirectorySpecifies the directory path name. If no parameter is specified, the main directory of CD is used as the working directory.
Option
No option. Switch to the main directory.
... Switch to the parent directory
... Switch to the parent directory of the parent directory.
CD-switch to the working directory used last time
Example CD
$PWD/Home/Siu/work/Home $ CD $PWD/Home/Siu
The first PWD confirms my current directory, then CD switches to the main directory, and then PWD confirms
Arbitrary CD directory
$ Cd/TMP $PWD/Tmp
Directly switch to the/tmp directory
CD ..
$ Cd... $PWD/
Switch to the parent directory. The parent directory here is the root directory.
CD-
$ CD/home/Siu/Work $ cd-/
Switch to the last directory
CD ../..
$ CD/home/Siu/Work $ CD ../... $PWD/Home
Multi-level return to parent directory
Tips
In fact, the options here are relatively common and do not exist in the standard documentation. To view the specific information, please refer to the man page, info page, help page ...... As for, it's not just about switching directories.