Detailed explanation of linux cd command

藏色散人
Release: 2022-11-29 16:14:10
Original
12846 people have browsed it

The function of the linux cd command is to switch the current working directory; the syntax of the cd command is "cd [dirName]", where the dirName representation can be an absolute path or a relative path; if the directory name is omitted, it changes to The user's home directory, the symbol "~" also represents the home directory, the symbol "." represents the current directory, and the symbol ".." represents the directory above the current directory location.

Detailed explanation of linux cd command

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

Detailed explanation of the linux cd command

The Linux cd (full English spelling: change directory) command is used to switch the current working directory.

Usage:cd [dirName]

where dirName is the directory name, which can be an absolute path or a relative path. If the directory name is omitted, it will switch to the home directory. ~ also means the home directory, . means the current directory, .. means the directory above the current directory.

The following is an example:

Jump to /usr/bin/

$ cd /usr/bin/
Copy after login

Jump to home directory

$ cd ~ 或 $ cd
Copy after login

Jump to root directory

$ cd /
Copy after login

Return to the directory where you were before entering the current directory

$ cd -
Copy after login

Jump to the upper level of the current directory

$ cd ..
Copy after login

Jump to the upper level of the current directory

$ cd ../..
Copy after login

The above are Usage of cd command

Sometimes you are not sure of the directory you are in. You can type pwd and you will see the path of the current directory

Recommended learning: "Linux Video Tutorial"

The above is the detailed content of Detailed explanation of linux cd command. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!