What does `cd ..` do?

QuestionsQuestions8 SkillsProDec, 18 2025
0101

Great question! While the tilde (~) takes you "home," the cd .. command moves you one level up in the directory hierarchy.

In the world of Linux:

  • The single dot (.) represents your current directory.
  • The double dot (..) represents your parent directory (the folder that contains the one you are currently in).

Let's look at an example:

If you are currently in:
/home/labex/project

And you run:

cd ..

Your new location will be:
/home/labex

Try it yourself!

  1. Go back to the project folder first: cd ~/project
  2. Then type cd .. and press Enter.
  3. Type pwd to see where you landed.

You can think of cd .. as the "Back" or "Up" button in a file explorer! Do you want to try moving into another folder next?

0 Comments

no data
Be the first to share your comment!