Linux Filesystem
Below a simple diagram which shows to the Linux filesystem structure
What does this all mean.
The Linux file system works only with files, everything you see are jut files and links to other files. Devices are listed in /dev as files. For example, your HDD or SSD wil be listed as: /dev/sdX (where X can be a,b,c,d etc). For nvram SSD’s it will look like: /dev/nvm01 and even voor SDCards it will look different, like: /dev/mmcblkX
To do a small comparison, Windows stores files in drives like C: D: E: etc, Linux uses a tree structure with the main directory being / or the root directory.
How is the Linux tree used:
/ – The root directory which holds all the other directories
/boot – The boot directory: all the needed files to boot the system, think of the kernel and bootloader files
/bin – Holds binary files (executables) which all users can run on a Linux system
/dev – The device directory, it shows you all devices on your system, example, /dev/sdX (HDD)
/etc – The main directory for configuration files, think of webserver config files, ftp, users, groups etc
/home – The home directory of every user added to the system by default
/lib – The main directory for system libraries, files that are used by programs to function properly
/media – Normally the system auto mounts external devices to this directory
/mnt – The default directory to manually mount files/devices, example: external drives
/opt – Directory that is used for manual compiled programs
/root – The home directory of user root
/sbin – Holds binary files (executables) which can only be run by root or users with superuser permissions
/srv – Holds the server data files like web servers or ftp servers
/sys – Shows virtual files that contain information about your system and connected devices (devices & drivers)
/tmp – The temporary directory stores files that programs store that are not needed right away
/usr – The old Linux home directory for users. Now it holds the user binaries under /usr/bin
/var – Variable files that change, like log /var/log files and mail for users