Skip to content

Latest commit

 

History

History
83 lines (57 loc) · 1.64 KB

File metadata and controls

83 lines (57 loc) · 1.64 KB

Linux Scripts

System Management

  • Retrieve system information:

    Information Command
    System information uname -a
    OS version cat /etc/os-release
    Hostname hostnamectl
  • Retrieve hardware details:

    Information Command
    CPU lscpu
    Memory (RAM) lsmem
    Storage (block) lsblk
    PCI devices lspci

Power Management

  • Reboot the system:

    sudo reboot
  • Shut down the system:

    sudo poweroff

Process Management

  • List running processes:

    ps aux
  • Monitor ongoing processes:

    top    # Classic version
    htop   # More modern and interactive version
  • Kill a process:

    kill -9 "<PID>"
    

Service Management

  • List all services:

    systemctl list-units --type=service
  • Check service status:

    systemctl status "<SERVICE>"
  • Start/Stop/Restart a service:

    Action Command
    Start sudo systemctl start "<SERVICE>"
    Stop sudo systemctl stop "<SERVICE>"
    Restart sudo systemctl restart "<SERVICE>"
  • Enable/Disable a service on boot:

    Action Command
    Enable sudo systemctl enable "<SERVICE>"
    Disable sudo systemctl disable "<SERVICE>"