What is the Structure of Linux? (Page 4 of 5)

Written by:  Tolga BALCI • Edited by: Lamar Stonecypher
Updated Mar 4, 2010
• Related Guides: File System | Linux | Windows XP

/proc

Welcome to the most interesting directory of the Linux file system. /proc is a virtual directory, or a pseudo-file system which does not include any files, but has a lot of them. Let me try to make this more clear. /proc is actually a folder which contains files that are created only when the system is running. The files in the directory have a file size of zero, so they are practically some shortcuts (or windows if you will) that points you to where actual information is.

Let me take it with an example, suppose that you want to know more about your processor (CPU.) During the start up, Linux kernel checks your processor, notes its flags (such as mmx, sse, pae instructions) and recognizes it. What if you want to see this information? You have to search the logs for the contents, you will go to the Internet and search for this specific processor and try to understand it. Or, the Linux way, you can type cat /proc/cpuinfo and learn everything (don’t be shy, try cat /proc/meminfo to learn about your main memory.)

/proc is not limited to checking some hardware information. It also has processes by their Process ID’s (PIDs.) Suppose that you are running a Gnome desktop manager. Checking the contents of /proc, you see that Gnome display manager is running with PID 4835. You can type cat /proc/4835 and see what the process is actually doing at this moment.

/root

/root is the home folder of the root user. In the early days, when I started playing with Linux, there was no /root directory, meaning that the system administrators can create any folder for themselves in the file system. This “root on root” concept became very confusing because the root user’s home directory was the system root, i.e. /. To overcome this confusion, Linux distributions now create a /root folder during the system installation. Linux standards dictate that the system should be such that, if a /root folder cannot be found, the system will default to the / directory.

/sbin

When we were discussing about the /bin directory, I have told that the essential commands are located in /bin. There is a distinction to make here which are the essential commands. Essential commands are the ones who are needed for system maintenance, such as copying and moving files, managing access permissions etc. The other commands, which are for administration purposes, are located in this directory. According to the Linux standards, these commands are the ones for booting, restoring, recovering and/or repairing the system. The shutdown command I have told above is under /sbin directory, similar to fdisk (to manipulate partitions), halt (stop the system), ifconfig (network interface configuration), mkfs (command for making file systems) etc.

/usr

Welcome to the most crowded folder in the Linux file system. This directory contains the installed programs which are open to all users, the programs’ libraries, header files, manual pages, X Window system, telnet, ftp etc.. According to the Linux standards, /usr directory is shareable, meaning that all users can access the contents but can not modify them.

It is interesting to see that there is also a /sbin folder under /usr. The programs in /usr/sbin are the ones that can be run by the root only for system administration purposes. For example useradd command, which adds users to the system resides in /usr/sbin.

The /usr directory contains a lot of subdirectories which are very important to know one by one, such as /usr/local, /usr/include, /usr/bin, /usr/share, /usr/src. I strongly recommend you to google about these directories and learn about their contents if you want to move ahead with Linux.

Showing page 4 of 5

 
blog comments powered by Disqus
Email to a friend