In 1994, FHS(Fileystem Hierarchy Standard) was proposed, it describes the directory structure of UNIX and UNIX-like systems(Linux). Before FHS was proposed, there had been UNIX-like operating systems which had their own standards. Today almost every UNIX-like systems notable Linux distros follow these guidelines.
The most common file hierarchy structure looks as below:
This is the primary direcotry, All the directories reside in this directory. The partition which the root file system resides on is mounted first during boot and the system will not boot if it doesn't find it.
This directory contains binary files of fundamental utilities like mv, ls, cp etc.. commands.
The startup files and the kernel, vmlinuz. In some recent distributions also grub data. Grub is the GRand Unified Boot loader and is an attempt to get rid of the many different boot-loaders we know today.
This directory contains device specific files like the usb, keyboard, mouse. So finding out a keyboard device file and piping in its specific code will resemble a key press. This is the best way to simulate user input like keyboard, mouse etc..
Contains system configuration files, change to these files will be reflected to all users. For user specific configuration modify the ‘.config’ directory present in user home directory.
This is the home directory where user data is stored. Each user gets a directory with directory name as user name.
Library files, includes files for all kinds of programs needed by the system and the users.
Every partition has a lost+found in its upper directory. Files that were saved during failures are here.
Standard mount point for external file systems, e.g. a CD-ROM or a digital camera.
Third party software files will be stored here.
A virtual file system containing information about system resources. Most commands like ‘top’, ‘ps’ etc..parse the files present in /proc to get processes information.
Home directory of root user. This is different from ‘/’ which is referred as root directory.
Programs for use by the system and the system administrator.
This directory gets cleaned on every bootup. Used as temporary file storage.
Programs, libraries, documentation etc. for all user-related programs.
Storage for all variable files and temporary files created by users, such as log files, the mail queue, the print spooler area, space for temporary storage of files downloaded from the Internet, or database specific data.
We can simply backup the whole filesystem excluding the /proc, /tmp and /dev as they are irrelevant on every boot. To backup the system it’s better to use ‘rsync’ command which has features to compress, doesn’t alter permissions etc..