The Linux cd command is the most basic command statement in Linux (Ubuntu/Fedora/CenOS/RedHat). Other command statements must be operated on using the cd command. Therefore, to learn common Linux commands, you must first learn the cd commands. This section describes how to correctly use Linux cd commands and Linux cd commands.
I. Linux cd command permission
The so-called permission is the system users who have the permission to use this command.
Linux cd command permission: All system users.
Ii. Linux cd Command Format
Linux cd Command Format: cd [directory name] (no square brackets in use)
Iii. Linux cd command functions
Linux cd command: changes the current working directory of the current user to the directory or folder specified in the cd command. If the target directory name is not specified (that is, only "cd" is input), the system returns to the active working directory of the current user. To access a specified directory, you must have the execution and read permissions on the specified directory (for details about how to modify file-Folder permissions, you can view: linux File Modification permissions ).
Iv. Linux cd command example
Example 1: Use the Linux cd command to return the current directory to the upper-level directory.
Use the following command to return the parent directory.
Cd .. // note that there is a space behind cd. Example 2: run the Linux cd command to access the parent directory of the current directory.
Run the following command:
Cd... // note that there is a space behind cd. Example 3: run the Linux cd command to enter the specified folder/home/cc/it.dengchao.org.
Run the following command:
Cd/home/cc/it.dengchao.org // note that there is a space behind cd to enter the specified directory.
Example 4: run the Linux cd command to enter the system root directory.
To enter the root directory of the system, you can use "cd .." to continue to return to the root directory.
Of course, you can also directly use the following command.
Cd/
Example 5: run the Linux cd command to enter the home directory of the current user.
"Current user home directory" and "system root directory" are two different concepts.
There are two methods to enter the current user's home directory.
Method 1: Use the following cd command
Cd
Method 2:
Cd ~ // Note that there is a space behind the cd
Both methods can be used to enter the current user's home directory.
V. Linux cd command usage Summary
Linux cd commands are frequently used in Linux and must be mastered. Use the "cd file address" to access any file address that the current user has access.