🐧 Linux Essential Commands Cheat Sheet – Top 50


πŸ“πŸ“‚ File and Directory Management

  • πŸ—‚οΈ ls – List directory contents
  • πŸ•΅οΈβ€β™‚οΈ ls -la – List all files with permissions
  • πŸ“‚ cd /path – Change directory
  • πŸ“Œ pwd – Print working directory
  • πŸ“ mkdir dir – Create a new directory
  • πŸ—‘οΈ rmdir dir – Remove empty directory
  • ❌ rm file – Remove file
  • πŸ’£ rm -r dir – Remove directory and its contents
  • πŸ“„βž‘οΈπŸ“„ cp src dest – Copy file or directory
  • πŸ”€ mv old new – Move or rename file/directory
  • πŸ”Ž find / -name file – Find file by name

πŸ“„πŸ“ File Viewing and Editing

  • πŸ‘€ cat file – View file content
  • πŸ“œ less file – Scroll through file
  • πŸ” head file – Show first 10 lines
  • πŸ”š tail file – Show last 10 lines
  • πŸ“‘ tail -f file – Monitor file in real-time
  • πŸ§‘β€πŸ’» nano file – Edit file in Nano editor
  • πŸ§™β€β™‚οΈ vim file – Edit file in Vim editor
  • πŸ†• touch file – Create an empty file
  • πŸ“˜ file name – Show file type

πŸ”πŸ“Š Search and Filter

  • 🧐 grep β€˜text’ file – Search for text in file
  • πŸ” grep -r β€˜text’ dir – Recursive grep in directory
  • πŸ“ awk β€˜{print $1}’ – Print the first column
  • βœ‚οΈ cut -d’:’ -f1 file – Cut by delimiter
  • πŸ“Š sort file – Sort file contents
  • 🧹 uniq file – Remove duplicate lines

πŸ”πŸ”§ Permissions and Ownership

  • πŸ” chmod 755 file – Set file permissions
  • πŸ‘€ chown user file – Change file owner
  • πŸ‘₯ chgrp group file – Change group ownership
  • πŸ“‹ umask – Show default permission mask

πŸ’»πŸ“ˆ System Info & Monitoring

  • πŸ“Š top – Display running processes
  • πŸŽ›οΈ htop – Interactive process viewer (if installed)
  • 🧾 ps aux – List all processes
  • πŸ’½ df -h – Show disk usage in human-readable format
  • πŸ“¦ du -sh dir – Show size of a directory
  • 🧠 free -h – Show memory usage
  • ⏱️ uptime – Show system uptime
  • πŸ”§ uname -a – Show kernel and system info
  • 🏷️ hostname – Display system hostname
  • πŸ™‹ whoami – Show current logged-in user

πŸŒπŸ“‘ Networking

  • πŸ“‘ ip a – Show IP addresses
  • πŸ“Ÿ ifconfig – (Older) show IP config
  • πŸ“Ά ping host – Ping a remote host
  • πŸ› οΈ netstat -tuln – Show open ports (if installed)
  • πŸ“ˆ ss -tuln – List sockets (faster replacement for netstat)
  • 🌐 curl url – Make HTTP request
  • πŸ“₯ wget url – Download from web
  • 🚚 scp file user@host:/path – Copy file over SSH
  • πŸ” ssh user@host – SSH into a remote host

πŸ“¦πŸ“€ Package Management

Debian/Ubuntu (APT-based)

  • πŸ”„ apt update – Refresh package lists
  • ⬆️ apt upgrade – Upgrade all packages
  • πŸ“₯ apt install pkg – Install a package
  • πŸ—‘οΈ apt remove pkg – Remove a package

RHEL/CentOS (YUM/DNF-based)

  • πŸ“₯ yum install pkg – Install a package
  • πŸ—‘οΈ yum remove pkg – Remove a package
  • πŸ“₯ dnf install pkg – (Fedora/CentOS 8+) install package

πŸ”πŸ§© Miscellaneous

  • πŸ•°οΈ history – Show command history
  • 🧩 alias ll=β€˜ls -la’ – Create alias
  • πŸ”„ reboot – Reboot system
  • β›” shutdown -h now – Shutdown immediately
  • πŸ“– man command – View manual for a command

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top