Menu

Sunday, November 27, 2011

Understanding Linux Directory Structure



/bin - It contains all the command line programs that are accessible to the users.  For example ln, mkdir, mount, ping, sync and etc...



/boot - All the files (Like kernel…) which are required to boot up the system are here. 


/devIn Linux, all the devices that are connected to the system will be treated like a directory/file. These virtual directories will be here. For example,  floppy, hard Drive, ram, audio and cdrom.


/etcThe configuration files for the operating system will be here. These are just a text files which can be edited by the user to change the configuration. Binaries files shouldn’t be kept here. For example,  hosts, httpd, cron, passwd and etc…


/homeThe default home directory for a non-root user will be here when a new user is added.  For example, if /home/username, /home/akila


/libShared libraries and kernel modules will be here. These files will be represented by ‘.so’.
It is similar to “DLL” in windows operating system


/lost+foundIf the Linux system is crashed, it will keep the files that it restores.

/media This is the place for mounting removable disks like Floppy, CD-ROM…

/misc This directory is for miscellaneous purposes.

/mntIn Linux everything will be considered a directory/file. To access the external devices, it should be attached to any of the directory in the file system. This is called mounting. The mount points for the each external device will be here.

/net – It is mount point for entire remote file systems.

/opt – The third party software will be stored here.

/proc – It is a virtual directory (doesn’t exist physically) like /dev, contains the process related information. The systems hardware information can be stored here. For example, zoneinfo, meminfo and etc…

 
/root – It is a default home directory for the root user.


/sbin System administrators programs are stored here.


/srv – It contains site-specific data which is served by this system.

/sys – It is similar to /proc. It contains information about the devices that are connected to the system. It is a kernel file system.


/tmp – A directory to keep temporary files used by the programs.

/usr – All user-related programs, libraries and documentations will be stored here.


/var – This directory contains variable data that keeps on changing. For example, logs, mail ..