Understanding the Linux Operating System and Its File System

Ashiqul Islam Eashan
2 min readJun 2, 2024

Introduction to the Linux Operating System

What is Linux?

Linux is an open-source, Unix-like operating system kernel that forms the foundation of many operating systems. It is known for its stability, security, and flexibility, making it popular for servers, desktops, and embedded systems.

History of Linux

  • Creator: Linus Torvalds
  • Year: 1991
  • Open Source: The Linux kernel is released under the GNU General Public License (GPL), allowing anyone to use, modify, and distribute it.

Key Features

  • Open Source: Freely available and modifiable.
  • Security: Strong user permissions and security features.
  • Flexibility: Suitable for various devices from desktops to supercomputers.
  • Community Support: Extensive documentation and support from a global community.
  • Multi-user and multitasking capabilities: Supports multiple users and concurrent processes.

The Linux File System

Structure of the Linux File System

Linux uses a hierarchical file system structure, starting from the root directory (/) and branching out into subdirectories.

Important Directories

Here’s a breakdown of some critical directories in the Linux file system:

  • / (Root): The top-most directory in the file system.
  • /bin: Contains essential user command binaries (e.g., ls, cp).
  • /sbin: Contains essential system binaries (e.g., systemctl, reboot).
  • /etc: Contains configuration files for the system.
  • /home: Contains personal directories for each user.
  • /lib: Contains shared libraries needed by binaries in /bin and /sbin.
  • /usr: Contains user binaries, documentation, libraries, and source code.
  • /var: Contains variable data like logs, databases, and mail spools.
  • /tmp: Temporary files created by system and users.
  • /dev: Contains device files representing hardware components.
  • /mnt: Standard mount point for temporary mounts.
  • /media: Mount point for removable media like USB drives.
  • /opt: Optional software packages.
  • /srv: Data for services provided by the system.

Mounting and Unmounting

  • Mounting: The process of making a file system accessible at a certain point in the directory tree. For example, mounting a USB drive:
mount /dev/sdX1 /mnt
  • Unmounting: The process of detaching a file system from the directory tree:
umount /mnt

File Permissions

In Linux, file permissions determine who can read, write, or execute a file.

Types of Permissions:

  • Read (r): Allows viewing the contents of the file.
  • Write (w): Allows modifying the contents of the file.
  • Execute (x): Allows running the file as a program.

Permission Levels:

  • Owner: The user who owns the file.
  • Group: The group that owns the file.
  • Others: Everyone else.

Example of changing file permissions:

# Changing file permissions
chmod 755 filename

# Changing file owner
chown user:group filename

Links:

  • Symbolic Links: Shortcuts pointing to another file.
  • Hard Links: Direct references to the data on the disk.

Device Files: Located in /dev, these files represent hardware devices.

Conclusion

Understanding the Linux file system is crucial for system administration, development, and general usage. It’s a foundational skill that enhances your ability to manage and navigate Linux effectively.

--

--