RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
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 this linux post:

Submit Filesystem Basics in Delicious Submit Filesystem Basics in Digg Submit Filesystem Basics in FaceBook Submit Filesystem Basics in Google Bookmarks Submit Filesystem Basics in Stumbleupon Submit Filesystem Basics in Technorati Submit Filesystem Basics in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download