Linux

🧭 1. Getting Started with Linux Shell

CommandDescription
pwdPrints the current working directory.
whoamiDisplays the current logged-in user.
hostnameShows the system’s host name.
dateDisplays current date and time.
calDisplays a calendar for the current month.
clearClears the terminal screen.
man <command>Displays the manual page for a command.
historyShows command history.
exitExits the current shell session.

📂 2. File and Directory Management

CommandDescription
lsLists files and directories.
ls -lLists files with details (permissions, size, etc.).
ls -aLists all files, including hidden ones.
cd <dir>Changes the current directory.
cd ..Moves up one directory level.
mkdir <dir>Creates a new directory.
rmdir <dir>Removes an empty directory.
rm <file>Deletes a file.
rm -r <dir>Deletes a directory and its contents recursively.
cp <src> <dest>Copies files or directories.
mv <src> <dest>Moves or renames files or directories.
touch <file>Creates an empty file or updates its timestamp.
cat <file>Displays file contents.
less <file>Views large files one page at a time.
head <file>Displays the first 10 lines of a file.
tail <file>Displays the last 10 lines of a file.
file <file>Determines the file type.

🔍 3. File Searching and Filtering

CommandDescription
find <path> -name <file>Searches for files by name.
locate <file>Finds files using a prebuilt database.
grep <pattern> <file>Searches for text patterns in files.
grep -r <pattern> <dir>Searches recursively in directories.
sort <file>Sorts lines in a file.
uniqRemoves duplicate lines from sorted input.
wc <file>Counts lines, words, and characters.
cut -d <delim> -f <n>Extracts specific fields from a file.
awk '{print $1}' <file>Prints selected columns using awk.
sed 's/old/new/g' <file>Substitutes text in a file using sed.

⚙️ 4. System Information and Monitoring

CommandDescription
uname -aDisplays system information.
topShows running processes and system resource usage.
htopInteractive process viewer (if installed).
ps auxLists all running processes.
free -hDisplays memory usage.
df -hShows disk space usage.
du -sh <dir>Shows the total size of a directory.
uptimeShows how long the system has been running.
lscpuDisplays CPU architecture information.
lsblkLists block devices (drives, partitions).
lshw -shortLists hardware information (requires root).

👥 5. User and Permission Management

CommandDescription
whoShows who is logged in.
usersDisplays current logged-in users.
idDisplays user ID and group ID.
adduser <username>Adds a new user.
passwd <username>Changes a user’s password.
su <user>Switches to another user account.
sudo <command>Executes a command with superuser privileges.
chmod <mode> <file>Changes file permissions.
chown <user>:<group> <file>Changes file ownership.
groupsLists groups a user belongs to.

🌐 6. Networking Commands

CommandDescription
ip addrDisplays network interfaces and IP addresses.
ifconfigDisplays network configuration (deprecated).
ping <host>Tests connectivity to a host.
traceroute <host>Traces network route to a host.
netstat -tulnLists listening ports and services.
ss -tulnModern alternative to netstat.
curl <url>Transfers data from or to a URL.
wget <url>Downloads files from the internet.
scp <src> <user>@<host>:<dest>Copies files over SSH.
ssh <user>@<host>Connects to a remote system via SSH.

📦 7. Package Management

CommandDescription
apt updateUpdates package index (Debian/Ubuntu).
apt upgradeUpgrades installed packages.
apt install <package>Installs a new package.
apt remove <package>Removes an installed package.
dnf install <package>Installs a package (Fedora/RHEL).
yum install <package>Installs a package (older RHEL/CentOS).
snap install <package>Installs snap packages.
dpkg -lLists installed packages.

🧩 8. Compression and Archiving

CommandDescription
tar -cvf <file.tar> <dir>Creates a tar archive.
tar -xvf <file.tar>Extracts a tar archive.
gzip <file>Compresses a file using gzip.
gunzip <file.gz>Decompresses a gzip file.
zip <file.zip> <files>Creates a zip archive.
unzip <file.zip>Extracts a zip archive.

🧮 9. Disk and File System Management

CommandDescription
mountMounts a filesystem.
umountUnmounts a filesystem.
blkidLists block device UUIDs.
fdisk -lLists disk partitions.
mkfs.ext4 <device>Creates a new ext4 filesystem.
fsck <device>Checks and repairs a filesystem.

🔄 10. Process and Job Control

CommandDescription
jobsLists background jobs.
bgResumes a job in the background.
fgBrings a job to the foreground.
kill <pid>Terminates a process by ID.
killall <name>Terminates all processes by name.
nice -n <value> <cmd>Runs a command with adjusted priority.
topDisplays real-time process information.

🧰 11. System Administration

CommandDescription
systemctl statusChecks the status of system services.
systemctl start <service>Starts a service.
systemctl stop <service>Stops a service.
systemctl enable <service>Enables a service at boot.
journalctlViews system logs.
shutdown -h nowShuts down the system immediately.
rebootRestarts the system.

🧑‍💻 12. Scripting and Automation

CommandDescription
echo "text"Prints text to the terminal.
read <var>Reads user input into a variable.
for i in {1..5}; do echo $i; doneExample of a loop in shell.
export <VAR>=<value>Sets an environment variable.
bash <script.sh>Executes a shell script.
crontab -eEdits scheduled tasks.
at <time>Runs commands at a specified time.

Organized into Modules

Perfect 👍 — you’re about to build a practical, concept-based mastery of Linux system commands.

Here’s the plan:
I’ll create a tutorial-style learning guide divided into modules, each focusing on a logical group of commands.
Each module will include:

  • Concept overview (what & why)
  • Command list with explanations
  • Illustrative examples
  • Practice exercises

Let’s start with the full outline first (so you can confirm the structure).
After that, I’ll expand each module in detail (and can generate a downloadable PDF later).


🧩 Linux System Commands — Step-by-Step Learning Guide

🗂️ Module 1: Introduction to Linux Shell

  • What is the shell and terminal?
  • Shell prompt structure
  • Basic navigation and help commands (pwd, whoami, man, clear, etc.)
  • Using history and command recall

📂 Module 2: File and Directory Management

  • Understanding the Linux file system hierarchy
  • Creating, deleting, moving, and copying files & directories
  • Viewing contents with cat, less, head, tail
  • Practical exercise: Build and navigate your own folder structure

🔍 Module 3: Searching and Filtering Data

  • Locating files and text content (find, grep, locate)
  • Using pipes (|) and redirection (>, >>, <)
  • Text manipulation with sort, uniq, cut, awk, sed
  • Exercise: Extract useful data from system log files

⚙️ Module 4: System Information and Monitoring

  • Viewing system information (uname, uptime, df, free, lsblk)
  • Monitoring CPU, memory, and processes (top, ps, htop)
  • Checking disk usage (du, df)
  • Exercise: Identify high-memory processes and summarize system status

👥 Module 5: User and Permission Management

  • Understanding users, groups, and permissions
  • Creating and managing users (adduser, passwd)
  • Changing ownership and permissions (chmod, chown)
  • Using sudo safely
  • Exercise: Set up a shared directory with proper access control

🌐 Module 6: Networking Commands

  • Viewing network interfaces and IPs (ip addr, ifconfig)
  • Connectivity checks (ping, traceroute)
  • Using ssh, scp for remote access
  • Basic network troubleshooting
  • Exercise: Connect two systems via SSH and transfer files

📦 Module 7: Software Package Management

  • Understanding package managers (apt, dnf, yum)
  • Installing, updating, and removing software
  • Searching for packages
  • Exercise: Install and configure a new tool (e.g., htop)

🧩 Module 8: Archiving and Compression

  • Creating and extracting archives (tar, gzip, zip)
  • Compressing large folders
  • Exercise: Backup your project directory into a compressed file

🧮 Module 9: Disk and File System Management

  • Understanding partitions and mounting
  • Viewing disks (lsblk, fdisk)
  • Mounting and unmounting file systems
  • Checking and repairing file systems
  • Exercise: Mount an external storage device manually

🔄 Module 10: Process and Job Control

  • Foreground and background processes
  • Managing jobs (jobs, bg, fg)
  • Terminating processes (kill, killall)
  • Exercise: Run multiple tasks and control them interactively

🧰 Module 11: System Administration and Services

  • Understanding systemd and services
  • Managing services with systemctl
  • Viewing logs with journalctl
  • Shutting down and rebooting safely
  • Exercise: Enable and monitor a background service

🧑‍💻 Module 12: Scripting and Automation

  • Basics of shell scripting
  • Variables, loops, and conditions
  • Automating tasks with cron and at
  • Exercise: Write a simple backup automation script

🧭 Module 13: Putting It All Together

  • Building your own Linux toolbox
  • Daily system health checks using combined commands
  • Mini project: Create a diagnostic script using all learned concepts