Navigate to parent directory in Linux

To navigate to the parent directory of the current working directory in Linux, we can use the change directory cd command.

Execute the cd command and pass the double dot .. as argument to the command, as shown in the following.

</>
Copy
cd ..

Or you can use the following format.

</>
Copy
cd ../

Example

In this example, we will navigate to the parent directory from a current working directory of /tutorialkart/logs.

Linux - Navigate to parent directory

We are at the current working directory /tutorialkart/logs.

</>
Copy
root@tutorialkart# pwd
/tutorialkart/logs

We have executed the change directory cd command.

</>
Copy
root@tutorialkart# cd ../

Then we moved to the /tutorialkart, which is the parent directory of /tutorialkart/logs.

</>
Copy
root@tutorialkart# pwd
/tutorialkart

Now, let us navigate to the parent directory of /tutorialkart, which is / or root directory.

Linux - Navigate to parent directory

Now, we are the the current working directory of /tutorialkart.

</>
Copy
root@tutorialkart# pwd
/tutorialkart

We have to execute the change directory cd command with the .. argument to move to the parent directory.

</>
Copy
root@tutorialkart# cd ../

We have moved to the parent directory.

</>
Copy
root@tutorialkart# pwd
/

Conclusion

In this Linux Tutorial, we learned how to navigate to the parent directory from the current working directly using change directory cd command.