File Structure in Li Unx
File Structure in Li Unx
LIUNX
Linux File System
❑ The OS stores data on disk drives using a structure called a
file system, consisting of files, directories, and the
information needed to access and locate them.
❑ There are many different types of file systems, and
improvements have been made to filesystems with new
releases, each given a different name, such as ext3, ext4,
xfs, NTFS, FAT, etc.
❑ Linux file system store information in a hierarchy of
directories and files.
File Structure in Linux
A Linux file system consists of organized files stored on a disk
drive or partition. A partition is a designated memory segment
that holds data. Our computer can have memory partitions,
each typically housing its file system.
The Root Directory (/) /bin - User Binaries /sbin - System Binaries
The root directory is the main The /bin directory stands for user The /sbin directory stands for
directory, or parent directory, of binaries. It holds the standard system binaries. It holds the root
Linux. Every single file and user commands information, user commands information and
directory starts from the root such as the executable files of can only be accessed by the root
directory. many basic shell commands like user for system maintenance
ls, cp, cd, etc. These programs purposes.
are mostly in binary format and
can be accessed by both the root
and standard user.
/dev - Device Files
Types of Device Files
The /dev directory holds the information about the • Block specific files: Used for parallel
hard disk and other devices connected to the communication, such as /dev/sda1 which
system. It contains special files that represent the represents the first partition of the base
physical devices on the computer. machine hard disk.
/lib - Shared Libraries
System Libraries (32-bit) System Libraries (64-bit)
The /lib directory holds the 32- The /lib64 directory stands for
bit shared libraries that support system libraries. It holds 64 bit
the binaries located under the OS information that supports
/bin and /sbin directories. These the binaries located under the
shared libraries are essential for /bin and /sbin.
the proper functioning of the
system.
/var - Variable Data Files
/tmp - Stands for temporary files. It holds temporary Stands for service data. It contains server specific
files created by system and users. Files under this services related data information. The /srv directory
directory are deleted when system is rebooted. contains data for services provided by the system. For
example, if you run a HTTP server, it's a good practice
to store the website data in the /srv directory.
Stands for Removable media Devices. Temporary Stands for optional software, contains add-on
mount directory for removable devices. When you application from individual vendors. Traditionally, the
connect a removable media such as USB disk, SD card /opt directory is used for installing/storing the files of
or DVD, a directory is automatically created under the third-party applications that are not available from the
/media directory for them. You can access the content distribution's repository. Add-on applications should
of the removable media from this directory. be installed under either /opt or /opt/. It is default
location for 3rd party package information.
/usr - User System Resources
/home /root
Home directory of standard or normal users. • Home directory of root user.
(Ex: /home/username)
Note: /root is root user home directory which is not
same as /.
/proc - Process
• The /proc directory is NOT a real file system but a virtual file system that is created dynamically by
Linux to provide access to certain types of hardware information and information about the
running processes.
• Any time a process is created in Linux, a corresponding files goes to /proc.
• Each and every process have individual process-ID. By default it have read only permission.
• This process executed in RAM memory. It also contains kernel information.
What Is "root" on Linux?
What Is "root" on Linux?
1. Root Partition (/)
• The root partition (/) is the top-level directory in a Linux filesystem, containing essential system files.
2. Root User
• The root user is the superuser with full system access, used for administrative tasks.
• The root user's home directory is /root, a private workspace for storing personal files and configurations.