0% found this document useful (0 votes)
48 views4 pages

Linux Directory

The document provides a comprehensive overview of the Linux directory structure, detailing the purpose and contents of key directories such as /bin, /sbin, /usr, /etc, /home, /var, /tmp, /dev, /mnt, /media, /opt, /proc, and /sys. Each directory is explained in terms of its significance for DevOps engineers and system administrators, with examples of commands to explore their contents. Understanding this structure is essential for effective navigation and management of the Linux filesystem.

Uploaded by

Shanu David
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views4 pages

Linux Directory

The document provides a comprehensive overview of the Linux directory structure, detailing the purpose and contents of key directories such as /bin, /sbin, /usr, /etc, /home, /var, /tmp, /dev, /mnt, /media, /opt, /proc, and /sys. Each directory is explained in terms of its significance for DevOps engineers and system administrators, with examples of commands to explore their contents. Understanding this structure is essential for effective navigation and management of the Linux filesystem.

Uploaded by

Shanu David
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Check Out Batch-9 Of DevSecOps & Cloud DevOps Bootcamp

Linux Directory Structure – The Ultimate Guide


Ever wondered what’s inside the Linux filesystem and why each directory exists?
Understanding the Linux directory structure is critical for any DevOps engineer, SysAdmin,
or Cloud professional!
Let’s break it down and explore the core directories you’ll work with daily!

/ (Root) – The Foundation of Linux


Everything in Linux starts from /. It is the top-most directory and all other directories are
inside it.

/bin – Essential User Binaries

Contains essential binary executables like ls, cp, mv, cat, grep.
Needed for the system to boot and run basic commands.
Try this:
ls /bin

/sbin – System Binaries

Contains system binaries for administrative tasks like shutdown, fdisk, iptables, mount.
Only root users can execute most commands here.
Try this:
ls /sbin

/usr – User Programs & Utilities

Contains user-installed software, libraries, and documentation.


/usr/bin → Non-essential system binaries
/usr/sbin → System admin binaries
/usr/local → Locally installed software

Check installed binaries:


ls /usr/bin
/etc – System Configuration Files

Contains all configuration files and startup scripts.


Examples:
/etc/passwd → User account details
/etc/fstab → Filesystem mounts
/etc/hosts → Hostname resolution

View system users:


cat /etc/passwd

/home – User Home Directories

Contains personal files, configs, and settings for users.


Example: /home/username contains files for username.

List all user home directories:


ls /home

/var – Variable Data Files

Stores log files, temporary files, cache, databases.


Important directories:
/var/log → Logs (e.g., /var/log/syslog, /var/log/auth.log)
/var/lib → Databases, package manager data
/var/tmp → Temporary files

View logs:
cat /var/log/syslog

/tmp – Temporary Files

Used for temporary storage, cleared on reboot.


Example: Applications store temporary files here.

Create a temp file:


touch /tmp/testfile
/dev – Device Files

Contains files representing devices like hard disks, USB drives, and terminals.
Examples:
/dev/sda1 → First partition of the first hard disk
/dev/null → Discard anything written to it
/dev/tty → Terminal devices

Check available disks:


ls /dev/sd*

/mnt & /media – Mount Points

/mnt → Temporary mount point for external storage.


/media → Auto-mounted external drives.

Mount a drive:
mount /dev/sdb1 /mnt

/opt – Optional Software Packages

Stores third-party software installed manually.

Example:
ls /opt

/proc & /sys – Kernel & System Information

/proc contains runtime system information, e.g., CPU, memory.


/sys contains kernel-related system files.

Check CPU info:


cat /proc/cpuinfo

You might also like