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

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
# which grep
# which mv
# which 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
# which ifconfig
# which fdisk

Therefore they are called as System binaries.

A good article on linux directory structure can be found here.

No comments:

Post a Comment