System and Process Management

System Management

Check Memory

  • free -m

Check CPU

  • top

  • mpstat -P ALL: Check cpu usage

  • lscpu | grep '^CPU(s):': check number of CPU cores

  • nproc: check number of CPU cores

  • grep -c ^processor /proc/cpuinfo: check number of CPU cores

Process Management

Backgrounding a Process

  • Add & to the end of command

  • Running command without & and use bg command to send it to background

List Jobs and Bring process to foreground

  • jobs: list all current running jobs in current session

  • fg [%|]: bring process to foreground

    • %+: current job

    • %-: previous job

Process Control

  • ps: see process status, system wide, not of current session like jobs

    • -e: all process

    • -f: full format listing

    • -C : select command name

  • kill : kill process

Last updated