Write a command to kill the last background job?

Kill $!

Showing Answers 1 - 1 of 1 Answers

sameer

  • Jan 14th, 2007
 

To kill the last background job, the following command is used:

$ kill $!

The system variable $! stores the PID of the last background job.

The other method is first find the PID using the ps command, then use kill command to do the job.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions