Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Wait for a process terminated

Answer:

wait command allow you to monitor the termination of a process and quit afterward.

It is very useful when you want to trigger some action when a particular process terminated.

E.g. Send an email when a long running process of PID 5870 terminated

#  wait 5870 && echo Finished | mail -s Task foo@example.com
  1. Prevent go way SSH session killing still running job
  2. Find the process ID of a running program
  3. How to send an email using a single command?
  4. Check latest Gmail inbox from command line
  5. How to kill a running process by name?

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>