The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  



The jobs command displays background processes. The jobs command can show background or paused processes under the current shell. The basic syntax of the 'jobs' command is: jobs [OPTIONS].

Common options for the jobs command include:

Example:
$ sleep 100 & ←Run 'sleep' in the background
[1] 680
$ seq 1 1000000 ←List numbers 1 to 1000000
1
2
3 Ctrl+Z ←Press <Ctrl+Z> to pause the 'seq 1 1000000' command
[2]+ Stopped                seq 1 100000000
$ jobs ←Display background or paused commands
[1] Running sleep 100 &
[2]+ Stopped seq 1 1000000

The jobs command is particularly useful when you have multiple background jobs running, and you want to monitor their status or perform actions on them, such as bringing them to the foreground using the fg command or sending signals to them using the kill command.

For more examples and explanations of operations, you can refer to this link.