Linux Blog

Guidelines for Beginners to Linux Directory Structure

Filed under: General Linux — TheLinuxBlog.com at 8:30 am on Friday, May 18, 2012

Guest Post by Brianne

Linux directory structure is not very complex but is different from the directory structure one comes across in other operating systems. The structure is so built that the different kinds of files with varied functions are effectively segregated into specific directories. The root partition and the root directory form the base of the Linux directory structure. Under the root directory, there are several directories that contain files meant for use for a particular purpose. System files are separated from the user files, so are the command and device files. Here is a detailed look at the various directories and the premise of their existence.

1. / or root directory
The root directory forms the base of Linux directory structure. Every other directory in the system comes under this directory.

2. /bin
This folder contains binary executable files relating to commands that can be used on the operating system. Each binary file represents a command or the system shell.

3. /boot
Boot loader files, the ones that are active at the time of the booting of system, are stored in this directory. Grub, initrd and kernel are a part of this directory.

4. /dev
This directory contains device files. Each device including the read & write devices connected with a system are represented as a device file.

5. /etc
System and network configuration files along with application configuration files are stored under this directory.

6. /home
The home directories of all users are stored in this directory. This does not have the root home directory though.

7. /lib
The binary files stored in the system under the /bin directory have a lot of library files associated with them which are stored under this directory.

8. /media
The removable media such as USBs and CD ROMs get a mount point on the system through this directory.

9. /mnt
This directory too serves as a mount point for files that are temporarily associated with the system.

10. /opt
Optional software packages in Unix systems find storage space under this directory.

11. /sbin
This directory contains binary files but differs from the /bin directory because it contains the files associated with system administration and maintenance.

12. /tmp
Temporary files in the system, whether generated by the user or the system, are stored in this directory. As the name suggests, the content is temporary in nature and is lost once you shut down the system.

13. /usr
User programs and the associated data are stored in this directory. It holds binary files under a subdirectory. The documentation and library files associated with the source code for user programs are also placed here.

14. /var
Files that contain data that is meant to change over a time are stored in this directory. This includes system log files and package files.

15. /srv
The service related data for servers associated with networks is stored under this directory.
The understanding of the directory structure and its organization helps people in gaining knowledge about the functioning of the Linux systems which are always considered more complex and difficult to handle as compared to other operating systems. The directory structure gives an idea of how well organized it is.

About the author: Brianne is a blogger by profession. She loves writing on technology and luxury. Beside this she is fond of books. Recently an article on Porcelain Tiles attracted her attention. These days she is busy in writing an article on paul allen yacht.





Random Man Pages:
Pod::Parser
charsets
gltext
x25

2 Comments »

Comment by Ricardo Bonilla

June 4, 2012 @ 10:12 am

I feel this kind of subject gets overlooked all too often. It’s good someone took the time to explain the small and simple things about Linux.

Comment by John Cartwright

June 4, 2012 @ 10:32 pm

With the move to a unified file-system that will see many directories in this list move under the /usr folder, the future Linux file-system will look very different indeed.

I believe that this will help Linux, it will be more compatible with the UNIX based operating systems out there and allow easier porting of software.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>