Linux – cd Command

The cd command stands for “change directory.” It is used to navigate between directories in the file system. By using the cd command, you can move to different directories, making it easier to manage files and directories.



Tutorials dojo strip

Initial Example

Using cd to change to a directory called Documents:

cd Documents




CD Parameters

ParameterDescription
-PUse the physical directory structure without following symbolic links
-LUse the logical directory structure as defined by the environment, including symbolic links




Examples

1. Navigate to the Home Directory

Using cd without any arguments will take you to your home directory:

cd

2. Navigate to the Parent Directory

The .. argument will move you up one level to the parent directory:

cd ..

3. Navigate to a Specific Directory

You can specify the path to a specific directory:

cd /path/to/directory

4. Navigate to the Previous Directory

Using - will take you to the last directory you were in:

cd -

5. Navigate to the Root Directory

The / argument will take you to the root directory:

cd /




Linux Playground

Scroll to Top