Linux Ubuntu Commands Cheat Sheet

350dcb74-2aef-484f-9808-b12ded18260f-DGs7Ep5KOU.webp

Basic Commands

  • 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 <package_name>

File and Directory Management

  • List Files: ls
  • Change Directory: cd <directory>
  • Create Directory: mkdir <directory_name>
  • Remove Directory: rmdir <directory_name>
  • Copy File: cp <source> <destination>
  • Move/Rename File: mv <source> <destination>
  • Remove File: rm <file_name>

File Permissions

  • Change Permissions: chmod <permissions> <file_name>
  • Change Ownership: chown <user>:<group> <file_name>

System Information

  • Check Disk Usage: df -h
  • Check Memory Usage: free -h
  • List Processes: ps aux
  • Check CPU Usage: top or htop

Networking

  • Check IP Address: ip a or ifconfig
  • Ping Host: ping <host>
  • Check Open Ports: netstat -tuln

Apache Commands

  • Restart Apache: sudo systemctl restart apache2
  • Stop Apache: sudo systemctl stop apache2
  • Start Apache: sudo systemctl start apache2
  • Check Apache Status: sudo systemctl status apache2

User Management

  • Add User: sudo adduser <username>
  • Delete User: sudo deluser <username>
  • Change User Password: sudo passwd <username>

Package Management

  • List Installed Packages: dpkg --list
  • Show Package Details: apt show <package_name>
  • Clean Package Cache: sudo apt autoremove and sudo apt clean

Log Files

  • View Log File: cat /var/log/<log_file>
  • Follow Log File: tail -f /var/log/<log_file>

This should cover the essentials! Let me know if you need more specific commands or details.

Author
No Image
Admin
MmantraTech

Mmantra Tech is a online platform that provides knowledge (in the form of blog and articles) into a wide range of subjects .

Write a Response