Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use the cd command of Linux

Shulou Source: shulou.com Published: 2022-06-01 06:35:12 10月16日 Update

This article mainly introduces how to use the Linux cd command, has a certain reference value, interested friends can refer to, I hope you have a lot of gains after reading this article, let Xiaobian take you to understand.

1. Linux cd command permission

The so-called use permission refers to which system users have permission to use this command.

Linux cd command usage rights: All system users.

2. Linux cd command format

Linux cd command format: cd [directory name] (used without square brackets)

3. Linux cd command function

Linux cd command function: to change the current user's current working directory to the directory or folder specified in the cd command. If no destination directory name is specified (i.e., just enter "cd"), return to the current user's home working directory. In order to be able to access a specified directory, the user must have execute and read permissions on the specified directory (see: linux modify file permissions for how to modify file-folder permissions).

4. Examples of using Linux cd command

Example 1: Use the Linux cd command to return from the current directory to the previous directory.

To return to the parent directory, use the following command.

cd .. //Note that there are spaces after cd Example 2: Use the Linux cd command to enter the parent directory of the current directory.

You can use the following commands:

cd ../.. //Note that there are spaces after cd Example 3: Use the Linux cd command to enter the specified folder/home/cc/it. dengchao. org.

You can use the following commands:

cd /home/cc/it.dengchao.org that there are spaces after cd so that you can enter the specified directory.

Example 4: Use Linux cd command to enter system root directory.

To access the root directory of the system, use " cd.. "Go straight back and you'll get to the root directory.

You can also use the following command directly.

cd /

Example 5: Use the Linux cd command to enter the current user home directory.

"Current user home directory" and "system root directory" are two different concepts.

There are two ways to access the current user's home directory.

Method 1: Use the cd command below

cd

Method 2:

cd ~ //note that there are spaces after cd

Both methods can be used to access the current user home directory.

V. Summary of Linux cd command usage

The Linux cd command is used very frequently in Linux and must be mastered. Use cd file address to access any file address that the current user has access to.

Thank you for reading this article carefully, I hope Xiaobian shared "How to use Linux cd command" This article is helpful to everyone, but also hope that everyone will support more, pay attention to the industry information channel, more relevant knowledge waiting for you to learn!

Tags: Commands directories permissions files users systems heads of users methods root directories articles folders two functions can make address format for directory name face work Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Microsoft MySQL vpn Apple