If you have several jobs in the background, you can refer to them by job number, as listed by thecommand. For example:
jobs + Stopped vi TODO  - Running nroff -ms ch01 %
You don't need to look up the job number to select a job, though. Instead, you can specify a job by name. Simply specify the command name instead of the job number after the percent sign. For example, the commands above could have been issued as:
If you use
%?, you can
specify any unique part of the job's command line.
What the manual fails to point out
is that if you do this, you may need to
the question mark, since it's also a shell wildcard.
If you don't,
you may get the message
You could type one of the following commands:
kill %?ch01No quoting (normal) %
kill %\?ch01Quoted (in some cases)
to kill the nroff job shown in the example above.
You can put a stopped job into the background in a similar way. For example:
will put job number 2 into the background.
Of course, it's also true that typing
without a job number can
save you time if there is only one job, or if you want to refer to
the current job.
The only problem is that the current job isn't always.
|12.1 Job Control: Work Faster, Stop Runaway Jobs||12.3 The "Current Job" Isn't Always What You Expect|