Understanding the Linux File System
Unlike Windows, which uses separate drive letters like C: or D:, the Linux file system is organized as a single, unified hierarchical tree starting from a single root directory represented by a forward slash (/).
Key Directories Explained
- / (Root): The top-level directory containing all other files and folders.
- /home: Contains personal directories for individual users (e.g.,
/home/username). - /etc: Holds system-wide configuration files and shell scripts.
- /bin and /usr/bin: Store essential executable command-line programs (like
ls,cp,cat). - /sbin and /usr/sbin: System binaries reserved for administrative (root) tasks and maintenance.
- /var: Contains variable data such as system logs, databases, and mail queues.
- /tmp: Temporary files created by the system and applications, usually cleared on reboot.
- /dev: Contains device nodes representing hardware components (like hard drives and USBs).
- /mnt or /media: Mount points used for temporarily attaching external storage devices like USB drives or shared network folders.
- /lib: Essential shared library files and kernel modules required by programs in
/binand/sbin. - /boot: Stores files needed during the boot process, including the Linux kernel and bootloader configuration.
- /proc: A virtual file system providing detailed information about running processes and kernel parameters in real-time.
Core Concepts
Everything in Linux—including files, folders, hard drives, and printers—is treated as a file or represented within this directory tree. Permissions and ownership are strictly managed to keep the multi-user system secure.
File Permissions and Ownership
Linux uses a robust security model based on user permissions, categorized into three types:
- Read (r): Permission to view the contents of a file or list a directory.
- Write (w): Permission to modify a file or add/remove files in a directory.
- Execute (x): Permission to run a file as a program/script or enter a directory.
Permissions are assigned to three distinct entities: the file Owner, the owning Group, and Others (everyone else on the system).