You can refer to any job by placing a % in front of its number. If you use fg without specifying a job, the last active one is assumed.
Ctrl-z
Re-suspends man cp.
kill %1
Kills off job 1. bash will report the job information, which will look like this:
$ kill %1
[1]- Terminated man cp
$
bash is only asking the job to quit, and sometimes a job will not want to do so. If the job doesn’t terminate, you can add the -KILL[[1]] option to kill to stop asking and start demanding. For example:
[1] Many people use the signal number -9 instead of the signal name -KILL. However, it’s technically more portable to use the signal name.
$ kill -KILL %1
[1]- Killed man mv
$
The -KILL option forcibly and unconditionally kills off the job.