2. Linux Filesystem Structure & File Management
Modules 3 & 4: Hierarchical directory tree, /etc, /var, /proc, file manipulation (cp, mv, rm, find, stat, du, df)
Module 1: Linux Filesystem & Directory Structure Hierarchy
Navigating standard Linux directory trees beginning at root /.
🇬🇧 English Definition
Linux uses a hierarchical filesystem beginning at root /. Important top-level directories include /etc (configuration), /var (variable data/logs), /home (user profiles), /boot (kernel boot files), /dev (device nodes), /proc and /sys (virtual kernel info).
🇮🇳 Hinglish Definition
Linux filesystem ka root / hota hai. /etc configuration, /var logs/changing data, /home user data, /boot boot files, /dev devices aur /proc,/sys system information ke liye important hain.
Core Concepts & Rules
- /etc: Stores all system-wide configuration files.
- /var: Holds dynamic data such as logs, mail queues, and web databases.
- /proc & /sys: Virtual filesystems exposing kernel runtime status and hardware parameters.
🔍 Line-by-Line Command Breakdown
- Line 1: ls -ld / displays root directory detailed permissions.
- Line 2: ls -ld /etc /var /home /tmp inspects major system directory properties.
- Line 3: find /var/log -maxdepth 1 -type f lists log files under /var/log.
- Line 4: df -h checks disk space usage across mounted filesystems in human readable format.
🎯 Interview Focus & Questions
- Q: What is /etc?
A: The main directory for system-wide configuration files. - Q: What is /var?
A: It stores variable data such as logs, caches and queues. - Q: What is /proc?
A: A virtual filesystem exposing process and kernel information.
ls -ld /
ls -ld /etc /var /home /tmp
find /var/log -maxdepth 1 -type f
df -h
mount
Module 2: File & Directory Management Operations
Mastering file creation, copying, moving, deletion, live search, and file inspection.
🇬🇧 English Definition
Master creating, copying, moving, deleting, finding and inspecting files. Understand file types, timestamps (atime, mtime, ctime), and wildcard pattern expansion.
🇮🇳 Hinglish Definition
Files ke create, copy, move, rename, delete, search aur inspect operations strong karo. rm -rf ko bahut carefully use karo.
Core Concepts & Rules
- cp vs mv: cp creates a copy; mv moves or renames a file/directory.
- find vs locate: find searches live filesystem dynamically; locate queries an indexed database.
- stat: Displays detailed inode metadata, file permissions, and modification timestamps.
🔍 Line-by-Line Command Breakdown
- Line 1: touch file.txt creates empty file or updates timestamp.
- Line 2: cp file.txt /tmp/ copies file.txt to /tmp directory.
- Line 3: mv file.txt new.txt renames file.txt to new.txt.
- Line 4: mkdir -p project/src creates nested parent and child directories.
- Line 5: find /var/log -type f -name '*.log' searches for all .log files under /var/log.
🎯 Interview Focus & Questions
- Q: cp vs mv?
A: cp creates a duplicate copy; mv moves or renames a file/directory. - Q: find vs locate?
A: find searches the filesystem live; locate searches an indexed database and may be stale.
touch file.txt
cp file.txt /tmp/
mv file.txt new.txt
rm new.txt
mkdir -p project/src
rmdir emptydir
find /var/log -type f -name "*.log"
stat document
du -sh /var/log