jobs — Return the status of jobs in the current session

Format

jobs [–l|–p] [job-identifier…]

tcsh shell: jobs [-l]

Description

jobs produces a list of the processes in the current session. Each such process is numbered for easy identification by fg or kill, and is described by a line of information:
[job-identifier]   default   state   shell_command
job-identifier
Is a decimal number that identifies the process for such commands as fg and kill (preface job-identifier with % when used with these commands).
default
Identifies the process that would be the default for the fg and bg commands (that is, the most recently suspended process). If default is a +, this process is the default job. If default is a , this job becomes the default when the current default job exits. There is at most one + job and one job.
state
Shows a job as:
Running
If it is not suspended and has not exited
Done
If it exited successfully
Done(exit status)
If it exited with a nonzero exit status
Stopped (signal)
If it is suspended; signal is the signal that suspended the job
shell_command
Is the associated shell command that created the process.

In the tcsh shell, jobs lists the active jobs. With-l, lists process IDs in addition to the normal information. See tcsh — Invoke a C shell.

Options

–l
Displays the process group ID of a job (before state).
–p
Displays the process IDs of all processes.

The –l and –p options are mutually exclusive.

Localization

jobs uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_CTYPE
  • LC_MESSAGES
  • NLSPATH

See Localization for more information.

Usage notes

jobs is a built-in shell command.

Exit values

0
Successful completion
2
Failure due to an incorrect command-line argument

Portability

POSIX.2 User Portability Extension.

Related information

bg, fg, kill, ps, wait, tcsh