If you have several jobs in the background, you can refer to them by
job number, as listed by the
 + Stopped vi TODO
 - Running nroff -ms ch01
You don't need to look up the job number to select a
Instead, you can specify a job by name.
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:
No quoting (normal)
Quoted (in some cases)
to kill the nroff
job shown in the example above.
There are a couple of other shortcuts as well.
A job number by
itself is the same as the fg
command followed by that job number.
You can put a stopped job into the background in a similar way.
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
what you expect (12.3