The present Filesystem Hierarchy Standard (FHS) in use today is version 2.3 which was unveiled in January of 2004. As more people continue to embrace open source systems such as Linux, the need to know more about critical aspects such as file systems becomes a necessity.
When trying to understand the Linux Filesystem Hierarchy, the starting point should always be to identify the entry point that is commonly referred as to the root. Most Windows OS users are aware that the root is typically identified with the letter representation of the hard disk which is usually C:. However, when it comes to Linux, things are a bit different. Unlike in Windows, Linux doesn’t identify the route with either a location or a physical device such as the computer’s hard drive.
Instead, it is a logical location only represented as “/.” In Linux, everything is viewed as a file while in other operating systems such as Windows, portions such as the disk drives might be portrayed as they are. As highlighted earlier, the hard disk is commonly represented with letters connoting the drive such as C:, D: E:. In Linux on the other hand, the drives are described as /dev/sda, /dev/sda1 which is basically one file showing where all the other files are.
On a more practical approach, the location of ‘My Documents’ on a popular operating system such as Windows will be C:UsersUserNameDocuments whereas the ‘documents’ in Linux would be located in /home/username/Documents. When you start getting comfortable using Linux, you will often wonder why different programs are located under different directories such as /sbin, /bin, /usr/sbin, or /usr/bin. Not all high-level directories were made the same. All these individual directories have a role and function that contributes to the whole system working as one.
/ – Root
This is where it all begins –defined as one forward slash. It is the logical entry point in the Linux file system. Every directory and file starts from this point in one way or another. It is also where the whole Linux OS is housed. It’s important to know that not all users have access to this directory. It’s only the root user who has the power and privilege to read and write under this directory.
This is the location of most of the binary files. Some handy commands used by both admins and non-privileged users such as mv, cp, cat, rm and ls are stored here. Unlike /usr/bin, the binary files located here are considered primary and as such essential. This is due to critical system programs housed there. In compliance with the Linux Filesystem Standard (FSSTND) document, /bin cannot have subdirectories.
/boot
This is the location of all the files needed by the operating system to fully boot. It’s common best practice to have these files on a different partition on the hard drive especially when you are dual*-booting. On Linux, even though you have installed the boot files on a separate partition, they are still logically located at /boot. The kernel also uses this location to keep relevant information such as backup master boot records, system map files and other critical data that cannot directly be changed by users.
/dev
This is the location where your physical devices such as USB drives, hard drives, optical drives, etc. are housed. As noted earlier, the system hard drive is mounted under this directory where we get /dev/sda and with a USB drive, /dev/sde. In windows, when we want to see the list of connected physical devices such as hard drives, we head on to the “My Computer” section where you see all the attached physical devices and drives. On Linux, /dev is its equivalent. When you dive into this directory, you will see what is meant by “everything is a file or directory in Linux.” While comparing the characteristics of the files located here and those of your hardware, you will quickly notice that you can influence devices from this location. For instance, when you send a file to /dev/lp0 which is the printer, it gets printed!
/etc
This is where all system related configuration files are located. The configuration file is defined as a local file that is used by a program; however, it must be static. Usually, the contents of this directory affect all users on the system regardless of their administrative power. Since it’s the files in here that are used to direct programs to perform various tasks, it’s usually prudent to regularly backup this directory as it might save you a lot of effort and tears if you lose or corrupt a current installation.
/home
It is the location where users usually spend a chunk of their time. Since Linux is a multi-user environment, each user must have a space to call their own which is only accessible by the user and the administrator. Under this directory, you will find your Downloads, Documents, Desktop, photos, etc. as such we have these items in a location such as /home/username/directory. Now, this is your playground. Here is where you make the magic happen. Whether you want to delete files, write them, install software, etc., it’s all done from this point. This location also houses the famous dot files, which are basically the configuration files for your account on a given machine.
/lib
This directory houses the libraries. They are basically modules that are needed to run commands in /sbin and /bin. Most of the time when we are installing Linux software, we can see libraries download automatically. These are system files that help a software to run.
/mnt
This is typically used as a placeholder folder for mounting other removable devices. If you want to add a network location, this is the location. For example, homes with media servers can use it as a mount point (/mnt/server). On Linux, a user is allowed to create mount points from just about any location. However, for the sake of practicality and organization, you shouldn’t have open mount points all over your system.
/opt
This location is used for add-on packages and software that was not part of the original installation. For instance, software such as Kylix, StarOffice, WordPerfect and Netscape Communicator are all found here in adherence to FSSTND guidelines.
/root
This is basically the home of the System Administrator. At first, the concept of root on root is a bit confusing but to keep things tidy, a home for the administrator was built. In here, the administrator is known as a superuser and is regarded as being the master of the system. Inside here there are no limitations to what the user can do. However, since some of the actions are irreversible, you should probably not touch anything unless you are one hundred percent sure of what you are doing.
In conclusion, I would love to remind our dear readers that Linux is a logical system as opposed to a physical one. Even though different folders might be in different sections of the hard drive, logically they are all in the same location. Starting out might seem a bit hard, but everything has a learning curve. The more you use the system, the faster you will understand it and eventually become a master. Distros of Linux that are graphic based such as Linux Mint and Ubuntu might be the best to ease the way as you start learning.
Sources
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-filesystem-fhs.html
https://wiki.debian.org/FilesystemHierarchyStandard
http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/
http://www.thegeekstuff.com/2010/09/linux-file-system-structure/
http://www.linuxandubuntu.com/home/the-linux-file-system-structure-explained