70 Essential Linux Commands Quick Reference
Use the table below for rapid lookup during server maintenance, shell scripting, or technical interviews.
Lesson 3 of 26 · Module: Linux
10 min read
Use the table below for rapid lookup during server maintenance, shell scripting, or technical interviews.
| # | Command | Category | DevOps Syntax Example | What It Does |
|---|---|---|---|---|
| 1 | ls | Filesystem | ls -lah /var/log | List directory contents including hidden dotfiles with file sizes. |
| 2 | pwd | Filesystem | pwd | Print current working directory absolute path. |
| 3 | cd | Filesystem | cd /etc/nginx && cd - | Change directory; cd - returns to previous path. |
| 4 | touch | Filesystem | touch app.js .env | Create blank files or update modification timestamp. |
| 5 | echo | Filesystem | echo "PORT=3000" >> .env | Print text or append strings to files. |
| 6 | nano | Editing | nano config.ini | Simple beginner terminal text editor. |
| 7 | vim | Editing | vim deployment.yaml | Industry standard modal text editor available on all UNIX systems. |
| 8 | cat | Filesystem | cat /etc/os-release | Print file contents to stdout. |
| 9 | shred | Security | shred -u -z token.txt | Securely overwrite and destroy sensitive credential files. |
| 10 | mkdir | Filesystem | mkdir -p /opt/app/logs | Create nested directories without failing if parents exist. |
| 11 | cp | Filesystem | cp -r src/ dist/ | Copy files and directories recursively. |
| 12 | mv | Filesystem | mv server.js index.js | Move or rename files and directories. |
| 13 | rm | Filesystem | rm -rf /tmp/cache_* | Force delete files and directories recursively. |
| 14 | rmdir | Filesystem | rmdir empty_dir/ | Remove empty directories safely. |
| 15 | ln | Filesystem | ln -s /etc/nginx/sites-available/x /etc/nginx/sites-enabled/ | Create symbolic links for virtual hosts. |
| 16 | clear | Terminal | clear | Clear terminal screen buffer (Shortcut: Ctrl+L). |
| 17 | whoami | Users | whoami | Display currently logged-in effective username. |
| 18 | useradd | Users | sudo useradd -m deployer | Create new system user account with home folder. |
| 19 | sudo | Security | sudo apt update | Execute command with elevated superuser (root) privileges. |
| 20 | adduser | Users | sudo adduser devops_user | Interactive user creation script. |
| 21 | su | Users | su - postgres | Switch to another user context with full login shell. |
| 22 | who | Users | who | List all users currently logged into the server. |
| 23 | exit | Terminal | exit | Exit current shell session or close SSH connection. |
| 24 | passwd | Security | sudo passwd ubuntu | Change user account password. |
| 25 | getent passwd | Users | getent passwd | grep ubuntu | Query user database entries from NSSwitch sources. |
| 26 | id | Users | id ubuntu | Show numeric UID, primary GID, and secondary groups. |
| 27 | userdel | Users | sudo userdel -r old_user | Delete user account and remove their home folder. |
| 28 | finger | Users | finger ubuntu | Inspect user account details and login history. |
| 29 | apt | Packages | sudo apt update && sudo apt install -y nginx | Manage Debian/Ubuntu software packages. |
| 30 | man | Help | man curl | Display comprehensive system manual page for a command. |
| 31 | whatis | Help | whatis iptables | One-line summary description of a command. |
| 32 | which | Help | which python3 | Print full absolute path of the executable found in $PATH. |
| 33 | whereis | Help | whereis nginx | Locate binary, source code, and manual page paths. |
| 34 | wget | Networking | wget https://example.com/archive.tar.gz | Download files from the web via CLI. |
| 35 | curl | Networking | curl -IL https://api.company.com | Transfer data and test REST API endpoints / headers. |
| 36 | zip | Archives | zip -r app.zip ./dist | Package and compress files into a zip archive. |
| 37 | unzip | Archives | unzip app.zip -d /var/www | Extract compressed zip archive. |
| 38 | less | Filesystem | less /var/log/syslog | View large log files page-by-page without filling memory. |
| 39 | head | Filesystem | head -n 20 error.log | View first N lines of a file. |
| 40 | tail | Filesystem | tail -f -n 50 /var/log/nginx/access.log | Stream and follow live updates appended to a file. |
| 41 | cmp | Comparison | cmp fileA.bin fileB.bin | Compare two files byte by byte. |
| 42 | diff | Comparison | diff -u old.conf new.conf | Show unified differences between two configuration files. |
| 43 | sort | Text | sort -n -r numbers.txt | Sort lines of text alphabetically or numerically. |
| 44 | find | Filesystem | find / -name "*.pem" 2>/dev/null | Search entire filesystem for files matching criteria. |
| 45 | chmod | Security | chmod 600 id_rsa && chmod 755 run.sh | Change file permission bits for Owner, Group, and Others. |
| 46 | chown | Security | sudo chown -R www-data:www-data /var/www | Change file and directory user and group ownership. |
| 47 | ifconfig | Networking | ifconfig | Legacy utility to inspect network interfaces and IPs. |
| 48 | ip address | Networking | ip a show eth0 | Modern utility to inspect network interfaces and IPv4/IPv6. |
| 49 | grep | Text | grep -rn "ERROR" /var/log/ | Filter text and recursively search directories using regex. |
| 50 | awk | Text | awk '{print $1, $7}' access.log | Process and extract columnar fields from logs. |
| 51 | resolvectl status | Networking | resolvectl status | Check active systemd DNS servers and resolution protocols. |
| 52 | ping | Networking | ping -c 4 1.1.1.1 | Test ICMP network reachability and packet latency. |
| 53 | traceroute | Networking | traceroute aws.amazon.com | Inspect network hop routing path and intermediate latency. |
| 54 | netstat | Networking | netstat -tulpn | Display active network connections and listening ports. |
| 55 | ss | Networking | sudo ss -tulpn | Modern high-performance replacement for netstat. |
| 56 | ufw | Security | sudo ufw allow 80/tcp && sudo ufw enable | Configure Uncomplicated FireWall rules. |
| 57 | uname | System | uname -mrs | Display kernel release name, version, and architecture. |
| 58 | neofetch | System | neofetch | Display aesthetic system hardware and OS summary. |
| 59 | cal | System | cal 2026 | Display command-line calendar. |
| 60 | free | Monitoring | free -h | Inspect total, used, and free RAM and Swap space. |
| 61 | df | Monitoring | df -h / | Inspect partition disk usage and available capacity. |
| 62 | ps | Monitoring | ps aux | grep nginx | Snapshot of all running processes across all users. |
| 63 | top | Monitoring | top | Real-time dynamic display of running system processes. |
| 64 | htop | Monitoring | htop | Interactive colored terminal process viewer with mouse support. |
| 65 | kill | Processes | kill -9 14522 | Send termination signal (SIGKILL) to process ID. |
| 66 | pkill | Processes | pkill -f "python worker.py" | Terminate processes matching regex pattern. |
| 67 | systemctl | Services | sudo systemctl restart docker | Control systemd service daemons (start, stop, status). |
| 68 | history | Terminal | history | grep ssh | Display command history list with timestamps and line IDs. |
| 69 | reboot | System | sudo reboot | Safely restart operating system instance. |
| 70 | shutdown | System | sudo shutdown -h now | Halt and power off virtual machine. |
Keep going: ← Lesson 2 · Lesson 4 → · Module overview · Track it in the Self Guide
Finished this one?
Part of Self Guide · Stage 1: Linux foundations. Progress is saved in this browser.



