Thursday, December 16, 2010
Getting started with Linux File System
Via my friend Sachin Nain...
Linux is a open source so every body has the freedom to put their source codes where he/she wants(Just like a person who want to decorate his home he is free to put things where he likes it). There are no boundation regarding it but if you want to distribute it then it may create the confusion to others because there are so many vendors of Linux (Suppose you are made to enter somebody's home and asked to find something from there then think of that situation. You will be total balnk).
So to avoid this confusion a International FSSTND ( File System Standard ) was made. So that user and developer should not get confused and to save the time in searching the things.
I am going to explain the Linux Dir. Structure based on FSSTND....
/
|---root
|---home
| |----ftp
| |----httpd
| |----samba
| |----user1
| |----user2
|---bin
|---sbin
|---proc
| |
| |----1
|
|---usr
| |
| |----bin
| |----sbin
| |
| |----include
| |
| |----lib
| |----local
| |----man
| |----info
| |----doc
| |----tmp
| |----X11R6
| |
| |----X386
|---boot
|---lib
| |----modules
|
|---dev
|---etc
| |----skel
| |----sysconfig
|---var
| |----file
| |----lib
| |----local
| |----lock
| |----log
| |
| |----run
| |
| |----spool
| |----tmp
| |
| |----catman
|---mnt
|---tmp
"/"
Root directory do not get confuse with root user account it is point where the Linux directory starts.(You may consider it as the main gate of a home)
"/root"
It is the super user home dir. Don't get confused with "/" dir.
"/home"
As Linux is the multiuser OS every user is given the personal dir to keep the related files, directories and configuration files and other stuffs. It is the playground for the user to do any thing like create, save and delete the files and installing the softwares. The config. files are saved with of '.' as the prefix which can be seen by giving '-a' as the argument to the ls command. The configuration file keeps the personal setting of the user like which environment is to start on login. Home dir contains the separate sub dir for each user.
You may consider the home dir as the House and user specific dir as the personal room of the individual family member in the house. Every member is free to do anything his/her room same in the linux.
"/bin"
It is the most essential directory of the linux operating system. It contains all the binaries for basic need of the system and command which are used by the multiple user. These can be used in single user mode even. This dir contains the commands which are used by the shell script indirectly.
"/sbin"
This dir is like the bin dir contains the basic binaries but these can be used by the 'super user' only.
e.g. shutdwon command which can be used by root user only
"/proc"
This dir contains the virtual files so called virtual file system.
It contains the the files which have the basic hardware, time, date and other system informations which keeps updated frequently. It contain bunch of numbers which have the information file related the particular process and the user login sessions etc.
"/usr"
This directory contains user applications and a variety of other things for them, like their source codes, and pictures, docs, or config files they use.
It also contains the c and c++ compiler header files in /usr/include subdir.
"/boot"
As the name suggests, this is the place where Linux keeps information that it needs when booting up. For example, this is where the Linux kernel is kept.
"/lib"
It contains the shared binaries at the root file system. It is just like the .DLL file in windows.
"/div"
It contains the devices which are available to your linux system. Like cdrom (/div/cdrom), harddrive(/div/hda).
Keep in mind linux treats the devices as the file.
"/etc"
This is the dir which contains the system and other config files. These files are the text files and can be edited manually.
"/var"
It contains the variables which keep changing constantly like log, mail, and spool.
"/mnt"
This is the mounting point of the other devices like harddrive, cdrom, pendrive etc. the need to be attached in the dir tree to access called mount point.
"/tmp"
This is the dir where a program writes the temporary files.
Subscribe to:
Post Comments (Atom)
Thanks a lot for sharing this nice post!You’ve done really excellent job!
ReplyDelete