feed-image  Delivered by FeedBurner  ISSN 1836-5930





Visitors Online

We have 42 guests online

Poll

Which of following tutorials would you like to see on the Linuxconfig.org?
 
Partner Linux Sites
TuxMachines
DebianAdmin
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
FreeSoftwareLinux
Jam's Ubuntu Blog
Androidtux
All For Linux

Filesystem Basics

This article explains basic commands for navigation within Linux file system. The diagram below represents (part of) a Linux file system know as Filesystem Hierarchy Standard. A line from one node to a node on its right indicates containment. For example, the student directory is contained within the home directory.

FileSystem Hierarchy Standard direcotry tree

1. When you are working within a shell terminal, you are always operating in a particular directory. To determine which directory you are in, use the pwd command:

student@linuxgym:$ pwd /usr/local/bin 
student@linuxgym:$ cd
student@linuxgym:$ pwd /home/student
student@linuxgym:$


2. Your home directory is the directory you are in when you first open the terminal. To go to your home directory from anywhere, just type "cd":

student@linuxgym:$ pwd
/usr/local/bin
student@linuxgym:$ cd
student@linuxgym:$ pwd
/home/student
student@linuxgym:$

3. An absolute path name is one beginning with the "/" character, which signifies the root of the file system tree. Therefore, another way of going to your home directory is:

student@linuxgym:/etc$ cd /home/student
student@linuxgym:$ pwd
/home/student
student@linuxgym:$

4. A relative path is one which starts with the name of a directory connected to the current directory. For example, if you are in the /usr directory, then typing only "cd bin" (without preceding "bin" with "/") has the following effect:

student@linuxgym:$ pwd
/usr
student@linuxgym:$ cd bin
student@linuxgym:$ pwd
/usr/bin
student@linuxgym:$

and you go to /usr/bin rather than /usr/local/bin or /bin. 5. To go to the directory containing the current working directory (also called the parent directory) type:

student@linuxgym:$ pwd
/usr/bin
student@linuxgym:$ cd ..
student@linuxgym:$ pwd
/usr
student@linuxgym:$

6. The relative pathname of the current working directory is called "." (the full stop). Therefore typing:

student@linuxgym:$ pwd
/usr/bin
student@linuxgym:$ cd .
student@linuxgym:$ pwd
/usr/bin
student@linuxgym:$

does not change the current working directory.


Share | Bookmark and Share  Support Linuxconfig.org by linking to us from your website or by donation.
Comments (0)
Write comment
Your Contact Details:
Comment:
Security
Please input the anti-spam code that you can read in the image.