jobs is used to display the status of jobs that are currently running in the background or suspended. When you run a command in a terminal, it may continue to run even after you close the terminal window or switch to another terminal window. Such commands are known as background jobs.
Basic Syntax
jobs [options]
Commonly Used Options
-
-l: This option displays the process IDs (PIDs) of the background jobs. -
-p: This option displays only the PIDs of the background jobs. -
-n: This option displays only the jobs that have changed status since the last notification. -
-r: This option displays only the running jobs. -
-s: This option displays only the stopped jobs. -
-x: This option displays only the jobs that have been started in the current shell session.
Useful Examples
-
jobs: This displays a list of all background jobs currently running in the shell. -
jobs -l: This displays a list of all background jobs along with their process IDs.
Leave a Reply