This is an old revision of the document!


Linux Process Management

  • process listing command

An example of a good general purpose process listing including a long formatted date-time of the start time of the command and the elapsed time since the process was started.

ps -eo pid,lstart,etime,cmd:128
  • List processes looking for specific process names.
  • Use a regex with a character class so that the grep command itself doesn't appear in the output of the ps command.
ps -ef | grep -i "[f]oobar"
  • process termination

When a process is started from a bash shell the process is a child of the shell and when the terminal session ends the child will be sent a signal that will result in the process being terminated. To prevent this the bash disown -ha command can be used to cause the child process to not receive the signal. As a result the process will remaining running after the terminal session ends.

nohup runs the specified program os that it will not receive hang-up signal when the terminal exists. Therefore the program will continue running like a daemon.

nohup /path/to/script.py &
  • linux/process_management.1493308042.txt.gz
  • Last modified: 2017/04/27 15:47
  • by mgupton