Multiple choice technology operating systems

Write a command to kill the last background job?

  1. Kill $!
  2. Kill $@
  3. Kill $%
  4. Kill $&
Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In shell scripting, $! is a special variable that holds the PID (Process ID) of the most recently executed background command. To kill the last background job, you use 'kill $!'. Other special variables like $@ (all arguments), $# (argument count), $? (exit status) serve different purposes. Only $! gives you the last background job's PID.