Managing Processes - Paiet/Tech-Journal-for-Everything GitHub Wiki

  • Monitoring Processes
    • ps (Process List)
      • 3 options
        • Unix options
          • Single dash before options
        • BSD options
          • No dash before options
        • GNU Long options
          • Two dashes before options
      • Common usage
        • ps -aux
          • -a List all processes
          • -u Display user and performance data
          • -x Display processes not attached to a TTY
        • ps -u user List processes of specific user
          • ps -u jbond
        • View process heirarchy
          • ps -aux --forest
        • Use grep to find specific process
          • ps -aux | grep lynx
    • pgrep
      • Same basic output as ps | grep
      • pgrep cron
      • pgrep -u root cron
    • top
      • top -d 10 Display updates every 10 seconds
      • top -p 4244 Display stats on PID# 4244
      • Single letter commands
        • k Kill a process
        • r Change a process' priority
        • P Sort by CPU usage
        • M Sort by MEM usage
          • free Displays basic MEM stats
  • Killing Processes
    • kill command
    • Kills process by PID
      • kill -l lists all the kill signals
        • 1 SIGHUP
        • 9 SIGKILL
        • 15 SIGTERM
      • Example
      1. Execute a command 2. ps -u dpezet 3. kill -9 <PID>
    • killall command
    • Kills process by name instead of PID
      • killall stress_cpu.sh
⚠️ **GitHub.com Fallback** ⚠️