🖥️ Basic Linux Terminal Commands Cheat Sheet

Below are essential Linux commands every beginner or ethical hacker should know. These apply to most Linux distributions, including Kali Linux, Ubuntu, Debian, etc.

📁 File and Directory Commands

  • ls – List directory contents
  • cd [directory] – Change current directory
  • pwd – Show present working directory
  • mkdir [dir] – Create a new directory
  • rm [file] – Remove a file
  • rm -r [dir] – Remove directory recursively
  • cp [src] [dest] – Copy files or directories
  • mv [src] [dest] – Move or rename files
  • touch [file] – Create an empty file
  • cat [file] – View file contents

🔧 System and User Commands

  • sudo [command] – Run command as root (superuser)
  • apt update – Update package lists (Debian/Ubuntu/Kali)
  • apt upgrade – Upgrade installed packages
  • whoami – Show current logged-in user
  • hostname – Display system hostname
  • reboot – Restart the system
  • shutdown now – Shutdown system immediately

🌐 Network Commands

  • ifconfig – Show network interfaces (older systems)
  • ip a – Show network interfaces (newer systems)
  • ping [host] – Test network connectivity
  • netstat -tuln – List listening ports
  • nmap [target] – Scan networks (requires nmap installed)

📄 File Permissions and Ownership

  • chmod [mode] [file] – Change file permissions
  • chown [owner] [file] – Change file owner
  • ls -l – List files with detailed permissions

⚙️ Process and System Monitoring

  • ps aux – Show running processes
  • top – Real-time system monitoring
  • kill [pid] – Terminate a process
  • df -h – Show disk space usage
  • free -m – Show memory usage

✅ Useful Shortcuts

  • Ctrl + C – Cancel current command
  • Ctrl + Z – Send process to background
  • history – Show command history
  • !! – Repeat last command

 


Note: Always exercise caution with root privileges. These commands are essential for system management, troubleshooting, and penetration testing within authorized environments.

No comments:

Post a Comment

Home About Privacy Contact Terms