6 - Linux navigation tree  

Navigation inside Linux terminal.

Since there are no file icons to click on, how do you find your files?

Every file lives inside a directory. Directories can contain files, other directories, or any combination of the two. Windows navigation tree example:

  • -this is a basic structure of a windows OS: Linux navigation tree inside terminal:

    In this picture you will see all the principal directories. Here is a short description of the main directories content:

  • /root -This your main account directory. The root user (you) have this space to keep all your downloads, and anything else you want to keep in there basically. Don't confuse the "root" directory with "root" meaning the super user. Two meanings for the same word.
  • /bin -This is where basic shell commands such as ls and mv reside. This directory is always in the executable path.
  • /boot -This is where the Kernel is stored and LILO gets its information from, and where module information is stored. your best bet is to ignore this directory completely as for a normal user, it is dangerous to play with
  • /dev -This is where your devices, or hardware is contained. Hardware devices can be accessed like files which is cool when you consider that you can echo a dial command to the modem on /dev/modem, and the modem will respond.
  • /etc -This is like the preferences folder on a Macintosh. Its a location where all programs create files that store their options. Here you can set up your preferences for an Internet connection, for QuakeII, for your eMail even.
  • /home -This is where your users have their accounts. If you have added any users other than your standard root account, they will show up here. It can also house the directories than your Web Server (Apache) accesses, if you have it installed.
  • /lib -This is where the basic libraries for booting Linux and running standard programs reside. Do not delete anything in this directory, ever.
  • /mnt -This is the location where you mount your cdrom, zip drives, or dos drives.
  • /opt -If you have this directory, its probably where Netscape has installed if you have chosen Netscape to be loaded. Red Hat's Applix office suite also installs here.
  • /proc -Again, Im not too sure what lives in here. It seems to be an area where information is kept on your hardware devices and system board. Id advise against deleting anything in that directory.
  • /sbin -Rather like /bin really. The 's' stands for System Binaries, where commands like shutdown lilo and fdisk are stored.
  • /tmp -A useless directory, its short for Temporary. When you install Linux first, it creates a file in your /tmp directory with all the details.
  • /usr -This is an interesting one. When you install programs like the GIMP, and Windowmaker, they need to be accessed by all users, so this is the directory they get installed into. Theres even another library directory for the new programs so that all users can see and access them. Basically, any program that is not automatically installed with the Distribution, and needs to be accessed by all users ends up in this directory
  • /var -This is where your log files, and printer files are kept. Its again something you shouldn't need to know too much about.
  • To navigate or to see what is in the / "root" folder we will use the "list" command:

    We can see we get a list of all the above directories that reside int the ROOT "/" directory.

    Now let's see what is in the HOME directory

    Always remember the slash before the name of the directory, otherwise you will get an error.

    Now in Linux we always have a "working directory" , even when we login we will be in our /home directory.

  • "working directory"= PWD(print working directory)
  • To find what is our actual "working directory" we will need to use the "PWD" command:

    Changing the working directory

  • to do so we will use the "CD"(change directory) command:
  • You can see our actual working directory before was our Home directory "home/wannabedba" and we have changed to "/home" by using the "cd" command.

    You can go up or you can go down the tree of directory's using the "cd" command as long as you will provide the full path after the "cd" command:

    You can see that we are in the "/" root folder and we want to go to the "/etc/emacs" , just by using the "cd" command followed by the full path to the directory we want . If you want to go down one directory you can use the "cd .." command:

    We can see that we went up one directory into our Documents and then we have moved down one dir back to our /home/wannabedba dir just by using the "cd .." cd followed by a empty space and two points.

    To go up one dir you just use the "cd /(name of the directory)" command.