In Linux, everything is treated as a file even if it is a normal file, a directory, or even a device such as a printer or keyboard. All the directories and files are stored under one root directory which is represented by a forward slash /.
- The Linux directory layout follows the Filesystem Hierarchy Standard (FHS).
- This standard defines how directories are organized and what types of files should be stored in each.
- Since Linux is based on UNIX, it inherits many of UNIX filesystem conventions.
- Similar directory structures are also found in other UNIX like operating systems such as BSD and macOS.
Types of files in the Linux system
Linux categorizes files into different types based on their purpose, such as general data storage, system structure, or device representation.

- General Files: They are also called ordinary files. It may be an image, video, program, or simple text file. These types of files can be in ASCII or Binary format.
- Directory Files: These types of files are a warehouse for other file types. It may be a directory file within a directory (subdirectory).
- Device Files: In a Windows like operating system, devices like CD-ROM and hard drives are represented as drive letters like F: G: H, whereas in the Linux system, devices are represented as files. For example, /dev/sda1, /dev/sda2, and so on.
We know that in a Windows like operating system, files are stored in different folders on different data drives like C: D: E:, whereas in the Linux/Unix operating system, files are stored in a tree like structure starting with the root directory, as shown in the diagram below.
The Linux/Unix file system hierarchy base begins at the root and everything starts with the root directory.
Top level directories associated with the root directory
These top level directories under the root (/) form the foundation of the Linux file system, each serving a specific role in organizing system files, user data, and configurations.

Steps to Check Linux Directories from Root (/)
- Open the terminal: Launch the terminal from the application menu or by using a keyboard shortcut.
- Switch to root user: Execute the command sudo -s and enter the system password to gain root privileges.
- Move to the root directory: Change the current working directory to the root (/) directory.
- List all directories in the root directory: Display all available directories present in the base directory.
- Review the directory structure: Observe the listed directories such as system, user, configuration, and virtual directories.

Exploring directories and their usability
In the Linux system some well defined configuration files, binaries, manual pages information files are available for every process.

Linux Kernel File:
- /boot/vmlinux : The Linux kernel file.
- /boot/grub/grub.cfg : the main generated configuration file actually used at boot time for GRUB
Device Files:
- /dev/hda : Device file for the first IDE HDD.
- /dev/null : A pseudo device (character device) that discards all data written to it and returns end-of-file (EOF) when read from.
System Configuration Files
System configuration files are essential files stored in the /etc directory that define system behavior, user access, boot settings, network rules, and service management in Linux.
- /etc/bashrc : Contains system wide default settings and aliases for the Bash shell.
- /etc/crontab : Used to schedule commands or scripts to run automatically at predefined time intervals.
- /etc/fstab : Contains details about disk drives and their mount points.
- /etc/group : Stores information about system groups and group memberships.
- /etc/default/grub : stores user-defined settings (like timeout, default kernel, boot options)
- /etc/init.d : Contains service startup and shutdown scripts.
- /etc/hosts : Maps IP addresses to corresponding hostnames.
- /etc/hosts.allow : Specifies which hosts are allowed to access services on the local machine.
- /etc/hosts.deny : Lists hosts that are denied access to services on the local machine.
- /etc/modules.conf : Contains configuration settings for system kernel modules.
- /etc/mtab : Provides information about currently mounted file systems.
- /etc/passwd : Contains user account information such as usernames and user IDs (passwords are stored in the shadow file).
- /etc/profile : Defines system wide environment settings for the Bash shell.
- /etc/profile.d : Contains additional scripts executed automatically after user login.
- /etc/resolv.conf : Stores DNS configuration used by the system.
- /etc/security : Contains security related configuration files, including login access controls.
- /etc/termcap : ASCII file defining behavior and capabilities of different terminal types.
- /etc/X11 : Directory containing configuration files for the X Window System.
User Related Files
A top-level directory in Linux that contains user-space programs, libraries, documentation, and shared data. Below are some examples :
- /usr/bin : Contains most of the user level executable programs and commands.
- /usr/include : Stores standard header files used by C and other programming languages.
- /usr/share : Contains architecture independent, shareable data such as documentation and text files.
- /usr/lib : Holds object files and shared libraries required by programs in /usr/bin.
- /usr/sbin : Contains administrative commands used by the system administrator (superuser).
Virtual and Pseudo Process Related Files
These /proc files provide real time system and process information generated dynamically by the Linux kernel.
- /proc/cpuinfo : Provides detailed information about the CPU, such as processor type, model, and speed.
- /proc/filesystems : Displays the file systems supported and currently available in the system.
- /proc/interrupts : Shows information about the number of interrupts handled by each IRQ.
- /proc/ioports : Contains details of input and output addresses used by hardware devices.
- /proc/meminfo : Reports detailed information about system memory usage.
- /proc/modules : Lists the kernel modules that are currently loaded in the system.
- /proc/mounts : Displays information about all mounted file systems.
- /proc/stat : Provides detailed statistics about system activity and performance.
- /proc/swaps : Contains information about swap space and swap files in use.
- /proc/version : Contains the Linux version information.
Log Files
These files record crucial system events, logins, and activity history for monitoring and troubleshooting.
- /var/log/lastlog : Stores information about the last login of each user.
- /var/log/messages : Contains general system activity and global log messages, though on modern systemd-based systems logging may instead be handled by journald
- /var/log/wtmp : Maintains a history of user login and logout sessions.