Command cd
Learn about the `cd` command in detail.
We'll cover the following...
The cd
command
Now that we have got everything about the current directory, we can change it.
Let’s suppose that we want to go to a directory named usr
. We will call the cd
command to go to the /usr
path. We can do it this way:
cd /usr
Let’s connect to the following terminal and run the above command.
Changing directories
Autocompletion works for both command and its parameters. Let’s try it in the terminal above this way:
- Type
cd /us
text. - Press the “Tab” key twice.
- Bash displays the directories that start with
/us
. - Complete our command by typing
r
ore
, and then press the “Tab” key once.
The following figure shows the result of these commands:
The cd
...