1. Basic Navigation & File Management Change Directory: cd [directory] (e.g., cd /var/log , cd .. , cd ~ ) List Contents: ls , ls -l (long format), ls -a (all files including hidden) Print Working Directory: pwd Create Directory: mkdir [directory_name] Create File: touch [file_name] Copy: cp [source] [destination] (e.g., cp file.txt /tmp/ ) Move/Rename: mv [source] [destination] (e.g., mv old.txt new.txt ) Remove: rm [file_name] , rm -r [directory_name] (recursive) View File Content: cat [file_name] , less [file_name] (scrollable), head [file_name] (first 10 lines), tail [file_name] (last 10 lines) 2. Permissions & Ownership Change Permissions: chmod [permissions] [file/dir] Numeric: chmod 755 script.sh ($rwx = 421$, $rwx-rx-rx = 755$) Symbolic: chmod u+x script.sh (user execute), chmod o-w file.txt (others no write) Change Ownership: chown [user]:[group] [file/dir] (e.g., chown user1:staff file.txt ) Change Group: chgrp [group] [file/dir] 3. Process Management List Processes: ps aux (all users), top (interactive) Kill Process: kill [PID] , kill -9 [PID] (force kill) Find Process ID: pgrep [process_name] Run in Background: [command] & (e.g., ./script.sh & ) Bring to Foreground: fg Suspend Process: Ctrl+Z 4. System Information Disk Usage: df -h (human readable) Directory Size: du -sh [directory] Free Memory: free -h Uptime: uptime Kernel Version: uname -r OS Version: cat /etc/os-release Hostname: hostname 5. Networking Network Configuration: ip a (show addresses), ip route (show routing table) Test Connectivity: ping [host] Trace Route: traceroute [host] DNS Lookup: dig [domain] , nslookup [domain] Listen Ports: ss -tuln (TCP/UDP listening numeric) Download File: wget [URL] , curl -O [URL] 6. Archiving & Compression Create Tarball: tar -cvf archive.tar [files/dirs] Extract Tarball: tar -xvf archive.tar Create Gzipped Tarball: tar -czvf archive.tar.gz [files/dirs] Extract Gzipped Tarball: tar -xzvf archive.tar.gz Zip: zip archive.zip [files] Unzip: unzip archive.zip 7. User Management Add User: sudo adduser [username] Delete User: sudo deluser [username] Change Password: passwd [username] Add to Group: sudo usermod -aG [groupname] [username] Switch User: su - [username] Run as Root: sudo [command] 8. Text Processing & Search Search for Text: grep "pattern" [file] , grep -r "pattern" [directory] (recursive) Find Files: find [path] -name "pattern" (e.g., find . -name "*.log" ) Edit File (Nano): nano [file_name] Edit File (Vim/Vi): vi [file_name] ( i for insert, Esc then :wq for save/exit, :q! for exit without save) Sort Lines: sort [file] Unique Lines: uniq [file] Count Lines/Words/Chars: wc [file] Stream Editor: sed 's/old/new/g' [file] (substitute all 'old' with 'new') Column Extractor: awk '{print $1}' [file] (print first column) 9. Package Management (Debian/Ubuntu) Update Package List: sudo apt update Upgrade Packages: sudo apt upgrade Install Package: sudo apt install [package_name] Remove Package: sudo apt remove [package_name] Search Package: apt search [keyword] List Installed: apt list --installed 10. Advanced Concepts & Scripting Redirection: > (redirect stdout to file, overwrite) >> (redirect stdout to file, append) 2> (redirect stderr to file) &> (redirect stdout & stderr to file) Piping: command1 | command2 (output of command1 becomes input of command2) Command Chaining: cmd1; cmd2 (run cmd1 then cmd2) cmd1 && cmd2 (run cmd2 only if cmd1 succeeds) cmd1 || cmd2 (run cmd2 only if cmd1 fails) Aliases: alias ll='ls -alF' (temporary), add to ~/.bashrc for permanent Environment Variables: export VAR="value" , echo $VAR Scheduled Tasks (Cron): crontab -e (edit user's crontab) Syntax: * * * * * command (minute, hour, day of month, month, day of week) SSH: ssh [user]@[host] (secure shell) SCP: scp [source] [destination] (secure copy, e.g., scp file.txt user@remote:/path/ ) 11. Pro-Level Tips History Search: Ctrl+R then type to search command history Command Line Editing: Ctrl+A : Go to beginning of line Ctrl+E : Go to end of line Ctrl+K : Delete from cursor to end of line Ctrl+U : Delete from cursor to beginning of line Alt+F : Move forward one word Alt+B : Move backward one word Shell Scripting Basics: Shebang: #!/bin/bash at top of script Variables: NAME="World" , echo "Hello $NAME" Conditionals: if [ -f "file.txt" ]; then echo "exists"; fi Loops: for i in {1..5}; do echo $i; done Functions: myfunc() { echo "Hello"; } Debugging: set -x (trace execution in scripts) Systemd Services: sudo systemctl start [service] sudo systemctl stop [service] sudo systemctl restart [service] sudo systemctl enable [service] (start on boot) sudo systemctl status [service]