Which one of the following command is used for killing the last background job?

Trang Esther

New member
Which one of the following command is used for killing the last background job?
A. kill $
B. kill $$
C. kill $!
D. kill !
 
Answer: c
Explanation: For most shells, the system variable $! Stores the PID of the last background job. So we can kill any process by using kill command. The PID of the job can be seen when & is affixed to a command. For example,
Code:
$ sort  -o  emp.lst &        
467
$ kill $!             // kills the sort command
 

Tìm kiếm

Back
Top