Linux Directory Structure
It is important to understand a basic Linux directory structure as you may use some of the directories or files already prepared by Linux OS.
The Linux directory structure starts with the root (/
) directory. Usually, there are around 10-20 directories under the root directory but the structure can differ by distribution.
As a normal user, usually, you have your own home directory which is created under the home directory. You may need to be careful when you call "home directory", it can be a user's home directory or the directory named home, which is the parent directory of each user's home directory.
Here are the major directories which you may often access when you use Linux OS.
bin
: contains essential user binary files
boot
: contains files used to boot the system
dev
: contains files related to device management
etc
: contains system-wide configuration files
lib
: contains libraries needed by the essential binary files
root
: root user's home directory
sbin
: contains essential system administration binary files
srv
: contains data for services e.g., website files for a web server
usr
: contains users’ applications and files
Note: Text File and Binary File
In a simplified explanation, there are two types of files – binary files and text files.
Binary files are not human-readable and require a special program or hardware processor that can read the data inside the file.
Text files are human-readable and text line-based files that you can directly edit with text editors.