Command to kill the last background job?
-
kill $!
-
kill -9
-
kill bg
-
kill $*
A
Correct answer
Explanation
In Unix shell scripting, '$!' is a special variable that holds the process ID (PID) of the last background job. 'kill $!' sends a termination signal to that process. Option B is incomplete (kill -9 needs a PID). Option C uses 'bg' which is not a variable for job reference. Option D uses '$*' which represents all positional parameters, not a background job. The $! variable is specifically designed to reference the most recent background job's PID.