Search This Blog

Sunday, September 26, 2010

Linux File System.

1) /

Only root user has write access under this directory .


# ls -ld /
drwxr-xr-x 36 root root 4096 Jul 23 13:06 /


many users assume it as root's home directory .
roots home directory is /root and not /.
# echo $HOME
/root


2) /bin

This directory contains the most commonly used commands.
The commands in this directory are used by almost all the users in the linux system.
For example .
ls ,cp,mv,grep.

# which cp
/bin/cp
# which grep
/bin/grep
# which mv
/bin/mv
# which ls
/bin/ls

{
Note : Which used to find the location of command.
In above example cp,grep,mv and ls commands are stored in /bin directory.
}

Therefore they are called as user binaries.

3) /sbin

This directory contains commands that are normally used by system administrators.

Commands like iptables (Used to modify firewall setting),ifconfig (Used to change ip address of machine) , fdisk (Used to make filesystem level changes) and many more.....

# which iptables
/sbin/iptables
# which ifconfig
/sbin/ifconfig
# which fdisk
/sbin/fdisk

Therefore they are called as System binaries.

A good article on linux directory structure can be found here.
http://www.thegeekstuff.com/2010/09/linux-file-system-structure/?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+TheGeekStuff+%28The+Geek+Stuff%29

No comments:

Post a Comment