A Linux file system is a structured collection of files on a disk drive or a partition. A partition is a segment of memory and contains some specific data. In our machine, there can be various partitions of the memory. Generally, every partition contains a file system.
The general-purpose computer system needs to store data systematically so that we can easily access the files in less time. It stores the data on hard disks (HDD) or some equivalent storage type. There may be below reasons for maintaining the file system:
Linux File System Component
The linux file system contains the following sections:
- The root directory (/)
- A specific data storage format (EXT3, EXT4, BTRFS, XFS and so on)
- A partition or logical volume having a particular file system.
Linux File System Structure
Linux file system has a hierarchal file structure as it contains a root directory and its subdirectories. All other directories can be accessed from the root directory. A partition usually has only one file system, but it may have more than one file system. Linux file system contains two-part file system software implementation architecture. Consider the below image:

The file system requires an API (Application programming interface) to access the function calls to interact with file system components like files and directories. API facilitates tasks such as creating, deleting, and copying the files. It facilitates an algorithm that defines the arrangement of files on a file system.
Directory Structure
The directory structure of Linux is well-documented and defined in the Linux FHS (Filesystem Hierarchy Standard). Referencing those directories if accessing them is achieved via the sequentially deeper names of the directory linked by '/'
forward slash like /var/spool/mail
and /var/log
These are known as paths.
root@ipxpy-debian-server:/# ls -lh
total 60K
lrwxrwxrwx 1 root root 7 Aug 14 21:37 bin -> usr/bin
drwxr-xr-x 4 root root 4.0K Aug 14 21:44 boot
drwxr-xr-x 14 root root 2.8K Sep 11 17:48 dev
drwxr-xr-x 70 root root 4.0K Sep 11 17:48 etc
drwxr-xr-x 4 root root 4.0K Sep 11 15:04 home
lrwxrwxrwx 1 root root 7 Aug 14 21:37 lib -> usr/lib
lrwxrwxrwx 1 root root 9 Aug 14 21:37 lib32 -> usr/lib32
lrwxrwxrwx 1 root root 9 Aug 14 21:37 lib64 -> usr/lib64
lrwxrwxrwx 1 root root 10 Aug 14 21:37 libx32 -> usr/libx32
drwx------ 2 root root 16K Aug 14 21:36 lost+found
drwxr-xr-x 2 root root 4.0K Aug 14 21:37 media
drwxr-xr-x 2 root root 4.0K Aug 14 21:37 mnt
drwxr-xr-x 2 root root 4.0K Aug 14 21:37 opt
dr-xr-xr-x 133 root root 0 Sep 11 17:48 proc
drwx------ 3 root root 4.0K Sep 11 17:42 root
drwxr-xr-x 21 root root 620 Sep 11 17:49 run
lrwxrwxrwx 1 root root 8 Aug 14 21:37 sbin -> usr/sbin
drwxr-xr-x 2 root root 4.0K Aug 14 21:37 srv
dr-xr-xr-x 13 root root 0 Sep 11 17:48 sys
drwxrwxrwt 10 root root 4.0K Sep 11 17:48 tmp
drwxr-xr-x 14 root root 4.0K Aug 14 21:37 usr
drwxr-xr-x 11 root root 4.0K Aug 14 21:37 var
root@ipxpy-debian-server:/#
- / (root filesystem): It is the top-level filesystem directory. It must include every file needed to boot the Linux system before another filesystem is mounted. Every other filesystem is mounted on a well-defined and standard mount point because of the root filesystem directories after the system is started.
- /boot: It includes the static kernel and bootloader configuration and executable files needed to start a Linux computer.
- /bin: This directory includes user executable files.
- /dev: It includes the device file for all hardware devices connected to the system. These aren’t device drivers; instead, they are files that indicate all devices on the system and provide access to these devices.
- /etc: It includes the local system configuration files for the host system.
- /lib: It includes shared library files that are needed to start the system.
- /home: The home directory storage is available for user files. All users have a subdirectory inside /home.
- /mnt: It is a temporary mount point for basic filesystems that can be used at the time when the administrator is working or repairing a filesystem.
- /media: A place for mounting external removable media devices like USB thumb drives that might be linked to the host.
- /opt: It contains optional files like vendor supplied application programs that must be placed here.
- /root: It’s the home directory for a root user. Keep in mind that it’s not the ‘/’ (root) file system.
- /tmp: It is a temporary directory used by the OS and several programs for storing temporary files. Also, users may temporarily store files here. Remember that files may be removed without prior notice at any time in this directory.
- /sbin: These are system binary files. They are executables utilized for system administration.
- /usr: They are read-only and shareable files, including executable libraries and binaries, man files, and several documentation types.
- /var: Here, variable data files are saved. It can contain things such as MySQL, log files, other database files, email inboxes, web server data files, and much more.
Linux File System Features
In Linux, the file system creates a tree structure. All the files are arranged as a tree and its branches. The topmost directory called the root (/) directory. All other directories in Linux can be accessed from the root directory.
Some key features of linux file system are as following:
- Specifying paths: Linux does not use the backslash (\) to separate the components; it uses forward slash (/) as an alternative. For example, as in Windows, the data may be stored in C:\ My Documents\ Work, whereas, in Linux, it would be stored in /home/ My Document/ Work.
- Partition, Directories, and Drives: Linux does not use drive letters to organize the drive as Windows does. In Linux, we cannot tell whether we are addressing a partition, a network device, or an “ordinary” directory and a Drive.
- Case Sensitivity: Linux file system is case sensitive. It distinguishes between lowercase and uppercase file names. Such as, there is a difference between test.txt and Test.txt in Linux. This rule is also applied for directories and Linux commands.
- File Extensions: In Linux, a file may have the extension ‘.txt,’ but it is not necessary that a file should have a file extension. While working with Shell, it creates some problems for the beginners to differentiate between files and directories. If we use the graphical file manager, it symbolizes the files and folders.
- Hidden files: Linux distinguishes between standard files and hidden files, mostly the configuration files are hidden in Linux OS. Usually, we don’t need to access or read the hidden files. The hidden files in Linux are represented by a dot (.) before the file name (e.g., .ignore). To access the files, we need to change the view in the file manager or need to use a specific command in the shell.
Types of Linux File System
When we install the Linux operating system, Linux offers many file systems such as Ext, Ext2, Ext3, Ext4, JFS, ReiserFS, XFS, btrfs, and swap.
Linux File Commands
Linux provides a variety of file commands that allow you to manipulate files and directories in the file system. Here are some commonly used Linux file commands:
- ls: List files and directories in a directory. els
- pwd: Print the current working directory.
pwd
- cd: Change the current directory.
cd /path/to/directory
- touch: Create an empty file or update the timestamp of an existing file.
touch filename
- mkdir: Create a new directory.
mkdir directoryname
- rmdir: Remove a directory (only if it’s empty).
rmdir directoryname
- rm: Remove files or directories.
rm filename rm -r directoryname # Use -r or -rf to remove directories and their contents recursively (be careful).
- cp: Copy files and directories.
cp source destination cp -r sourcedir destination # To copy directories and their contents recursively.
- mv: Move or rename files and directories.
mv oldname newname # To rename a file or directory. mv source destination # To move a file or directory to another location.
- cat: Concatenate and display the content of a file.
cat filename
- more and less: Display text files one screen at a time. You can scroll through the file using the arrow keys.
more filename less filename
- head and tail: Display the beginning or end of a file.
head filename # Display the first few lines. tail filename # Display the last few lines.
- ln: Create hard or symbolic (soft) links to files.
ln -s source linkname # Create a symbolic link.
- chmod: Change file permissions.
chmod permissions filename
- chown: Change file ownership.
chown owner:group filename
- find: Search for files and directories in a directory hierarchy.
find /path/to/search -name filename
- grep: Search for text patterns in files.
grep pattern filename
- wc: Count the number of lines, words, or characters in a file.
wc filename
- file: Determine the file type.
file filename
- stat: Display file or file system status.
stat filename
- du: Display disk usage of files and directories.
du -h directory # -h for human-readable output.
These are some of the essential Linux file commands that can help you manage files and directories efficiently in a Linux-based system. Remember to use these commands carefully, especially when dealing with the removal or modification of files and directories, as they can have significant consequences on your system.
Linux File Commands Example

01.
Design
Aenean diam dolor, accumsan sed rutrum. Lorem ipsum dolor sit amet.
02.
Quality
Aenean diam dolor, accumsan sed rutrum. Lorem ipsum dolor sit amet.
03.
Innovation
Aenean diam dolor, accumsan sed rutrum. Lorem ipsum dolor sit amet.
04.
Execution
Aenean diam dolor, accumsan sed rutrum. Lorem ipsum dolor sit amet.