|
Quick links About
jobs Syntax Examples
Related commands Linux / Unix main page
About jobs
Lists the jobs that you are
running in the background and in the foreground. If the prompt is
returned with no information no jobs are present. Note: not all shells
are capable of running this command.
Syntax
jobs [-p | -l] [-n] [-p]
[-x] [job id]
| -p | -l |
Report the process group ID and working directory
of the jobs. |
| -n |
Display only jobs that have stopped or exited since last notified. |
| -p |
Displays only the process IDs for the process group leaders of the selected jobs. |
| -x |
Replace any job_id found in command or arguments with the corresponding process group ID, and then execute command passing it arguments. |
| job id |
The job id. |
Examples
jobs
Would display results similar to the below
if jobs were running in the background.
[1] + Stopped (user) man jobs
As you can see in the above job example the id is 1 it
has been stopped by the user and the process in this case is man jobs
(looking at the manual for jobs).
jobs -l
The above command would not just list the jobs
running but also this group ID and the working directory of the
jobs. Below is an example of what this would display.
[3] 16882 Running ./chsearchproc (wd: ~/public_html/cgi-bin/chsearch)
Related commands
at csh
kill ksh
ps sh |