Forrest logo
back to the jobs tool

jobs:tldr:62f27

jobs: Show process IDs of all jobs.
$ jobs -p
try on your machine

The command "jobs -p" is used in a command-line interface (such as Unix or Linux shell) to display the process IDs (PIDs) of all currently running background jobs. When you run a command or script in the background by appending "&" at the end of the command, it gets executed independently while allowing you to continue using the terminal. However, sometimes you may want to view the list of background processes to monitor their progress or manage them. The "jobs" command lists all the background jobs along with their job numbers, state, and command descriptions. By adding the "-p" option, you instruct the command to only display the process IDs (PIDs) of these background jobs. For example, if you have three background jobs running with process IDs 1234, 5678, and 9012, running the command "jobs -p" would output: 1234 5678 9012 This can be useful if you need to check or interact with specific background processes by referencing their PIDs for further actions or analysis.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the jobs tool