Thursday, May 3, 2012

The Linux Directory Structure

All operating systems have a directory structure in which system files are stored. User files will also be stored in a directory created by the OS itself unless otherwise specified. Of course, the user can create his own directories, but those do not constitute the system’s directory structure. The following directories are commonly found in Linux:


The basic directory is the “/ ” directory simply called the slash.
This contains other directories used for various system purposes.


/bin
This is the   binary  directory, which contains the executable files.When a program is installed, its binary files are stored here.


/dev
dev stands for “devices.”   /dev  contains files that point to the hardware that make up the system. All peripherals are represented as files, and when the service of a device is called for, the file is looked
into for the device description and parameters.


/boot
The boot loader files are stored here. Sometimes, an image of the kernel is also maintained in this directory.


/etc
This folder contains various configuration files that can be manually edited to effect system changes. This is a particular feature of Linux by which, knowing what to alter in what files, the user can make almost any change to the system. The files are stored in the .txt format, and can be viewed and modified in any editor.
A crude analogy with Windows is the set of .ini files, and of course, the Registry.


/home
This is the directory that contains the user’s files. Unless otherwise specified, work files will be saved in a user directory that is created for each user in this   /home  directory. If a user is created by the name of   “rahul”  , then his files will get stored in the   “/home/rahul”  folder.


/root
This is the home directory of the root user.


/lib
“Library” filesfrequently-used system files needed by programs or the operating system are stored here, just like the library files stored in “  C\windows\system”  in Windows operating systems


/mnt
All storage media other than Linux partitions are “mounted” here. Each device has a folder created for it, for example, the CD-ROM and the floppy drive. Windows drives/partitions too are mounted here. (A FAT file system is seen as a Windows drive). To access these devices, you need to get to the /mnt directory and open the appropriate device there. There can be a shortcut to the devices on your desktop or elsewhere, depending on the Linux you have, but then these shortcuts will access the devices mounted in this folder.


/opt
The “options” directory stores add-on components such as desktop environments, databases (such as Oracle), etc. A crude analogy would be the Program Files in Windows.


/tmp
This one is simple, isn’t it As the name suggests, this is the temporary directory that the system uses for various purposes that we, as end users, need not be too worried about.


/usr
Non-critical system files are stored in this directory, which contains a copy of most of the directories in the root you’ll find here a “bin” directory containing programs, a “lib” directory containing libraries,
etc. Generally, important or core Linux files are contained in the root directories, while others are put in the   /usr  subdirectories.


/var
The   various  folder contains just thatvarious files such as log files, spools, etc.

0 comments:

Post a Comment