Processes

  • Program running on a system is a process. Linux is a multi-processing (multi-tasking) system.
  • Attributes: Lifetime, PID, PPID, UID, GID, env variables, CWD.
  • Process with PID=1 is init
  • Monitoring: ps (for full listing, use ps -ef or ps -aux) top, pstree
  • Signal a running processes with PID=1009: kill -HUP 1009 #Hang up; re-read config files kill -1 1009 kill -INT 1009 #Interrupt, Ctrl-C kill -2 1009 kill -9 1009 #Kill; stop unconditionally kill -TERM 1009 kill -15 1009 #Terminate gracefully kill -TERM 1009 kill -TSTP 1009 #Suspend; can be continued kill -18 1009
  • Process can be started with lower and higher priority through nice (range: -20, +19) nice 10 matlab
  • Process can be re-niced at run time: renice 5 1009
  • Suspend interactive process and move it to the background: Ctrl-Z jobs bg %1 jobs
  • Move a background process to the foreground: fg %1
    Previous Pageprevious First Pagetop Next Pagenext