Linux File System Made Easy
Linux File System Made Easy
/
├── bin
├── boot
├── dev
├── etc
├── home
├── lib
├── media
├── mnt
├── opt
├── proc
├── root
├── sbin
├── tmp
├── usr
└── var
/ (Root Directory)
What it is: The top-most directory in the file system. All other directories and files
stem from here.
Example: Think of it as the trunk of a tree, from which all branches (other directories)
grow.
/bin (Binaries)
What it is: Contains essential user command binaries (executable programs) that are
used in single-user mode and for basic system operations.
Examples:
o ls: Lists directory contents.
o cp: Copies files.
o mv: Moves files.
Real-life Example: Imagine /bin as a toolbox containing essential tools that you need
to perform basic tasks, like a hammer or screwdriver.
/boot
What it is: Contains files required for the boot process, such as the Linux kernel and
bootloader configuration files.
Examples:
o vmlinuz: The compressed Linux kernel.
o grub: The bootloader files.
Real-life Example: This is like the ignition system of a car. Without the contents of
/boot, the system can't start.
/lib (Libraries)
What it is: Contains shared library files that are required by the binaries in /bin and
/sbin.
Examples:
o libc.so.6: A critical library for C programs.
o ld-linux.so: The loader for dynamic libraries.
Real-life Example: Libraries in /lib are like the utility pipes in a house that are shared
by all rooms (directories) to provide essential services like water or electricity.
/etc/passwd
/etc/shadow
/etc/group
/etc/hosts
~/.ssh/authorized_keys
/var/log/auth.log or /var/log/secure
What it is: Authentication logs.
Key Details:
o Logs successful and failed login attempts.
o /var/log/auth.log is used in Debian-based systems, /var/log/secure in Red Hat-based
systems.
Why it’s important:
o Useful for detecting brute force attacks or unauthorized access.
o Red teamers might clear or alter these logs to cover their tracks.
/root/.bash_history