How to go back two directories?

QuestionsQuestions8 SkillsProDec, 18 2025
0116

To go back two levels in the directory structure at once, you use the following command:

cd ../..

Breakdown:

  • The first .. represents the parent directory.
  • The forward slash / is a separator.
  • The second .. represents the parent of that directory.

So, if you are currently in /home/labex/project:

  1. cd .. would take you to /home/labex.
  2. cd ../.. would take you all the way back to /home.

Just like before, remember to keep a space after the cd command!

0 Comments

no data
Be the first to share your comment!