What's the name of the top-level directory

10,182

This directory is called the root directory and is referenced by the symbol "/"

You can try cd / to go there.

Notice that if you try this:

$ cd /
$ cd ..

You're still at the root directory.

NB: Every Unix system has a super user account called root, whose home directory is /root. I know it's redundant, it can be ambiguous and lead to confusion. So make sure, every time you mention "root" to know whether it refers to the directory / or the (super)user.

Share:
10,182

Related videos on Youtube

Mellon
Author by

Mellon

Updated on September 18, 2022

Comments

  • Mellon
    Mellon almost 2 years

    I am using Ubuntu.

    I know by using cd ~/ , I can go to home/ directory.

    But if I want to go to the directory (I do not know the official name of this directory) which contains etc/, var/, opt/, ... sub-directories, what is the symbol used to refer to this directory? (And by the way what is the official name of this directory? root directory?)

    Basically, I would like to cd to that directory without using cd .. but one symbol to refer to it, is there such a symbol for it (like ~ refers to home directory)?

    • Admin
      Admin over 12 years
      Btw, you can use cd without args to go to your home.
    • Admin
      Admin over 12 years
      and you dont have to write the leading / -- cd ~ without the / is enough
  • Mellon
    Mellon over 12 years
    do you mean "cd .." will stop when it reaches the root directory? Can I understand in this way?
  • rahmu
    rahmu over 12 years
    Yes that's a very good way to look at it. My advice to you is to experiment as much as you can and read a unix tutorial. (hint: pwd will output your current working directory)
  • Fiasco Labs
    Fiasco Labs over 12 years
    It's the root of the tree and is written as /. In node parlance, everything branches off from root until you get to the leaf nodes (files)