Linux Classes
Linux Training
* Linux Classes *

LINUX CLASSES - FILES

How Do Linux File Directories Work?

Directories



 

 
A Linux directory is a special file that acts as a container for other files and even other directories. You can create directories to hold groups of related files as an alternative to keeping all your files in one huge directory.

A Linux file system is like a filing cabinet with a bunch of folders, each of which can contain subfolders and files.

After installing Linux and creating a new hermie user account, you'll end up with a file system hierarchy like the one shown here.

 

 

 

              /                                   <-- The root of the file system
|
|
+------------+-------------+
| | | | | | |
| | | | | | |
bin dev etc home sbin root usr <-- Directories below the root
|
+-----+-----+
| |
hermie sigmund <-- User home directories

Figure 4-1

As you can see, the file system resembles an upside-down tree and is very similar to the treelike directory structure in DOS. The top level is denoted by a slash (/) and is called the root directory. Several system-related directories such as bin, dev, and etc appear below the root directory--here's a summary of their purpose in life:

/bin Contains the Linux system commands and programs (also called binaries). Pronounced "slash bin."

/dev Contains special device files that correspond to hardware components. Pronounced "slash dev."

/etc Contains configuration files for Linux and other installed software. Pronounced "slash et-see."

/home Contains the home directories (personal storage) for each user on the system. Pronounced "slash home."

/sbin Contains more Linux binaries (special utilities not for general users). Pronounced "slash ess-bin."

/root The home directory for the root user; not to be confused with /. Some Linux systems use /home/root instead of /root. Pronounced "slash root."

/usr  Contains system programs and other files for general users such as games, online help, and documentation. By convention, a user should not put personal files in this directory. Pronounced "slash user."

Note: Unless you are an All-Knowing Linux Guru, you should never combine or delete any of the directories (or files therein) that appear just below the root directory. This could prevent your system from booting or operating properly.

Previous Lesson: Linux File Names
Next Lesson: Directory Terminology

[ RETURN TO INDEX ]

Comments (most recent first)

Nasir     (29 May 2010, 00:39)
this is very useful information here on this site.
can any one tells us about linux servers such as Asterisk, Qmail and others.

Regard
Bob Rankin     (17 May 2010, 12:03)
Nothing to do with the Google ads, really. Just that I have a 2-column layout in that part of the page. I've added a few blank lines to fix the problem.
Eric D     (17 May 2010, 09:56)
@Conor

He is using Google Ads causing the page shift and causing the viewing issues.
Conor     (05 May 2010, 16:17)
I'm enjoying the tutorials but your directory structure isn'.t showing up properly - the lines are breaking in all the wrong places. Might have something to do with the width of my browser window but it doesn't look the same for everybody.

Perhaps you could put the diagram in image form? Of course, everybody viewing it from a terminal wouldn't be able to see it then...
chandana     (05 May 2010, 00:56)
Great tutorial, enjoyed every bit of it. Can u please deal with linux in dba perspective?
rp     (13 Apr 2010, 03:19)
what is the /var diractory
PJ     (24 Feb 2010, 02:19)
This is a very informative and well explained tutorial for beginners like me.Thanks a lot!!!!!!

*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:
 

Ask Bob Rankin - Free Tech Support
<Send This Link to a Friend>         <Bookmark This Page>


Copyright © by Bob Rankin
All rights reserved - Redistribution is allowed only with permission.