What's the Unix command-line symbol for "the PID of the last suspended process"?
You might be looking for the $!
variable (bash manual, section Special Parameters).
However, you don't need the PID – the built-in kill
command also accepts job identifiers, such as %2
, which are shown when you press Ctrl-Z or type jobs
. You can use %
, %+
or %%
to refer to the latest job. (Other possibilities are in bash manual, section Job Control.)
>>>
[4]+ Stopped python
$ kill %4
jobs -p %
It shows PID of last suspended job (after pressing Ctrl+z
).