%
is the
"current" stopped or background job, but not
always the last
one.
If you've stopped any jobs, the current job is the most recently stopped
job.
Otherwise, it's the most recent background job.
For example, try stopping your editor (like vi
), then putting
another job in the background:
sleep
|
% vi afile
[CTRL-z]
Stopped
% sleep 1000 &
[2] 12345
% fg
|
and notice that the fg
brings your editor to the foreground.