How to Put a "Running Job" in the Background.

You’re running a job at the terminal prompt, and it’s taking a very long time. You want to put the job in the backgroud.

“CTL – z” Temporarily suspends the job $ jobs This will list all the jobs $ bg %jobnumber (bg %1) To run in the background $ fg %jobnumber To bring back in the foreground

Need to kill all jobs — say you’re using several suspended emacs sessions and you just want everything to exit.

$ kill -9 `jobs -p`

The “jobs -p” gives the process number of each job, and the kill -9 kills everything. Yes, sometimes “kill -9” is excessive and you should issue a “kill -15” that allows jobs to clean-up. However, for exacs session, I prefer “kill -9” and haven’t had a problem.

Sometimes you need to list the process id along with job information. For instance, here’s process id with the listing.