The Story of Linux and Its Files
The Story of Linux and Its Files
1. Regular (Ordinary) Files – These include text files, scripts, executables, and logs.
2. Directories – Special files that store references to other files.
3. Symbolic (Soft) Links – Pointers to other files, similar to shortcuts.
4. Device Files – Represent hardware components like disks, printers, and terminals.
Each file has read (r), write (w), and execute (x) permissions, which can be viewed using:
ls -l
Directory Purpose
/bin Essential system binaries
/etc Configuration files
/home User home directories
/var Log and variable data
/dev Device files
/mnt Mount points for external devices
This hierarchy ensures data integrity and ease of access. Volumes can be formatted with file
systems like ext4, XFS, or Btrfs to optimize performance and reliability.
Linux's design makes file management intuitive, secure, and efficient. Whether handling system
processes, user data, or network communication, understanding the file system is key to
mastering Linux!
Users create files, and Linux sees everything as a file. Whether it is a document, a directory, a device, or
even a network socket, it is all represented as a file. This foundational principle simplifies the way Linux
handles data and system components.
1. Regular (Ordinary) Files – These include text files, scripts, executables, and logs.
4. Device Files – Represent hardware components like disks, printers, and terminals.
To see these types, use the following command:
bash
CopyEdit
ls -alih
bash
CopyEdit
$ ls -alih
total 52K
In the output:
A directory in Linux is simply a special file that contains pointers to other files. Each file is linked to an
inode (index node), which stores metadata about the file, such as its size, permissions, ownership, and
timestamps. The inode does not store the filename but holds the location of the data on disk.
Since files store essential data, they require proper permissions to maintain security. Linux uses a three-
tier permission system:
1. Owner (User) – The creator of the file.
Each file has read (r), write (w), and execute (x) permissions, which can be viewed using:
bash
CopyEdit
ls -l
bash
CopyEdit
Linux permissions are often explained using a numeric model (421). The numbers represent the
permissions for read (4), write (2), and execute (1), which can be combined to form different permission
sets for each user category.
0 --- No permissions
Number Permission Description
For example, to give the file myfile read, write, and execute permissions for the owner, and read and
execute permissions for the group and others, you would run:
bash
CopyEdit
Where:
To maintain order, Linux follows the Filesystem Hierarchy Standard (FHS), which defines how files and
directories should be structured:
Directory Purpose
This hierarchy ensures data integrity and ease of access. Volumes can be formatted with file systems like
ext4, XFS, or Btrfs to optimize performance and reliability.
Linux's design makes file management intuitive, secure, and efficient. Whether handling system
processes, user data, or network communication, understanding the file system is key to mastering
Linux!