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:
root(/):
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.
/bin:
This directory contains binary files of fundamental utilities like mv, ls, cp etc.. commands.
/boot
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.
/dev
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..
/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.
/home
This is the home directory where user data is stored. Each user gets a directory with directory name as user name.
/lib
Library files, includes files for all kinds of programs needed by the system and the users.
/lost+found
Every partition has a lost+found in its upper directory. Files that were saved during failures are here.
/mnt
Standard mount point for external file systems, e.g. a CD-ROM or a digital camera.
/opt
Third party software files will be stored here.
/proc
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.
/root
Home directory of root user. This is different from ‘/’ which is referred as root directory.
/sbin
Programs for use by the system and the system administrator.
/tmp
This directory gets cleaned on every bootup. Used as temporary file storage.
/usr
Programs, libraries, documentation etc. for all user-related programs.
/var
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.
Tip:
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..
Micropyramid is a software development and cloud consulting partner for enterprise businesses across the world. We work on python, Django, Salesforce, Angular, Reactjs, React Native, MySQL, PostgreSQL, Docker, Linux, Ansible, git, amazon web services. We are Amazon and salesforce consulting partner with 5 years of cloud architect experience. We develop e-commerce, retail, banking, machine learning, CMS, CRM web and mobile applications.
Django-CRM :Customer relationship management based on Django
Django-blog-it : django blog with complete customization and ready to use with one click installer Edit
Django-webpacker : A django compressor tool
Django-MFA : Multi Factor Authentication
Docker-box : Web Interface to manage full blown docker containers and images
More...