Search code examples
bashjobs

Kill jobs from the background


I have two jobs running

me@me:~$ jobs
[1]-  Running                 emacs --daemon &
[2]+  Running                 emacs &

I want to kill the job 1 and get it done in a cumbersome way

fg 1
Ctrl + C

Is it possible to kill it on the background without put it to the forewords.


Solution

  • You may find this link helpful.

    Basically, type jobs to see a job list, and type kill %{job #} to kill a specific one.

    So in your example, kill %1 should do the trick.