usage rights: all roles
How to use:CD [TargetDir]
role: This command is used to switch the working directory in Linux
Note the point:
The 1.targetDir represents the target directory and can be represented by an absolute or relative path;
2. When TARGETDIR is omitted, it will switch to the user's home Directory (typically/root)
3. When TARGETDIR is "~", it will also switch to user's home Directory
4. "." Represents the current directory
5. ".." Represents the previous level of the current directory, or in the case of a continuous multi-tiered directory switch, the ".." Add "/" after
Examples of Use:
1. Use absolute path
(1) (assuming my current directory is/) enter/USR/ETC:CD/USR/ETC or CD usr/etc
(2) (assuming my current directory is/home) into/USR/ETC:CD/USR/ETC
(3) Enter home DIRECTORY:CD or CD ~; Note that home directory here does not refer to//, but refers to the default directory that the user enters
2. Using relative paths
(1) Go to sub-directory admin (assuming I am currently in the directory/usr/etc, there is folder admin under it)
CD Admin
(2) Enter the parent directory: CD.
(3) go to upper Parent directory: CD. /..
Summary: from the above can be learned that in absolute path access, the front must have "/" symbol, and the relative path to access subdirectories, do not have to add "/" symbol; When you select a path, you can quickly enter the form of the first few letters + TAB
Linux Command Learning Path-Change Working directory: CD