The cd command
Yaser Rahmati | یاسر رحمتی
The cd
command is used to change the current working directory (i.e., in which the current user is working). The "cd
" stands for "change directory" and it is one of the most frequently used commands in the Linux terminal.
Examples of uses:
Change the current working directory:
Change the current working directory to the home directory:
Change to the previous directory:
Change the current working directory to the system's root directory:
Quick Tips
Adding a
..
as a directory will allow you to move "up" from a folder:
This can also be done multiple times! For example, to move up three folders:
Syntax:
Additional Flags and Their Functionalities:
Short flag | Long flag | Description |
---|---|---|
-L | - | Follow symbolic links. By default,cd behaves as if the -L option is specified. |
-P | - | Don’t follow symbolic links. |
Last updated