CD Switch Directory
Command English original intention
Command function
Common options
Simplify Operations |
function |
CD ~ or CD |
Go to the current user's home directory |
CD- |
Go to last Directory |
Cd.. |
Go to the top level directory |
Cd. |
Go to current directory |
Common examples
Switch between home directory and destination directory
[email protected]:~$ cd parent/child/[email protected]:~/parent/child$ cd ..[email protected]:~/parent$ cd -/home/whoami/parent/child[email protected]:~/parent/child$ cd -/home/whoami/parent[email protected]:~/parent$ cd ~[email protected]:~$ cd
Absolute path
With respect to absolute paths, simply the complete path starting with the root "/" directory, which is the end of the directory you want to go to, in the form of:
/usr/local/bin
A directory that represents a directory in the directory under the root directory usr
local
bin
.
Relative path
Relative path, which is the path relative to your current directory, relative to the current directory. As the starting point, take the directory you want to the end, the manifestation of the form such as:
usr/local/bin
(This assumes that the current directory is the root directory.) Indicates that the relative path does not actually include the one that represents the current directory, .
but rather begins with the directory name, because this directory is a subdirectory usr
of the /
directory, which can be omitted, and if it is the .
top level directory of the current directory, ..
it is required For example, if your current directory is a home
directory, the root directory should be represented as the ../../
top level directory (directory) of the previous level directory (home directory) /
.
Linux File Management CD