Navigate between Directories
After learning this lesson, you'll be able to switch and navigate between directories with ease.
We'll cover the following
cd
Definition:
cd
— short for “change directory” — is used to change Shell’s current working directory. We use this command frequently to work around the hierarchy of our file system. This command is similar to chdir
command in MS-DOS.
Syntax:
cd [option] [directory_name]
Options:
Option | Meaning |
---|---|
/ | To change the current directory to Root directory |
-L | This mode lets cd move directly to the directory the link is pointing to |
-P | This mode is opposite of -L. It uses physical directories and does not follow symbolic links |
-e | This option is only used to show an error in case the cd command fails to determine the directory |
Example:
- To move from current directory to parent directory
cd ..
Get hands-on with 1400+ tech skills courses.