How many levels up can you go?

QuestionsQuestions8 SkillsProDec, 24 2025
0124

You can go up until you reach the Root Directory, which is represented by a single forward slash (/).

In Linux, the file system is shaped like an inverted tree. The Root Directory is the very bottom of the trunk (or the absolute top of the hierarchy). There is nothing above it.

How to test this:

  1. Keep typing cd .. repeatedly.
  2. Eventually, when you type pwd, it will just show /.
  3. If you try to go up again by typing cd .. while at the root, you will simply stay there. The system won't give an error; it just knows there is nowhere higher to go.

The levels in your current lab:

  1. Level 0: /home/labex/project (Where you normally work)
  2. Go up 1 level: /home/labex (Your Home directory, ~)
  3. Go up 2 levels: /home (Where all users' folders are kept)
  4. Go up 3 levels: / (The Root — You have reached the top!)

Pro Tip: No matter how deep you are in the folders, if you want to jump straight to the very top in one go, you can just type:

cd /

And if you get lost and want to go back to your starting point, remember: cd ~ will bring you straight home!

0 Comments

no data
Be the first to share your comment!