jobs command is a built-in Linux command that is used to display the status of jobs that are running in the background or suspended. It is used to check the status of jobs that are started with
jobs command displays a list of all jobs that are running in the background or suspended. It provides information such as the job number, status, and command that is associated with each job. The job number is used to identify a specific job when using other commands such as
jobs command can be used in various ways, including:
- Display a list of all jobs that are running in the background or suspended:
- Display the status of a specific job by specifying the job number:
$ jobs %1
- Display the status of all jobs in the current shell session:
$ jobs -l
jobs command comes with the following options:
||Displays the process ID (PID) of each job in addition to the job number and status.|
||Displays the status of jobs that have changed since the last notification.|
||Displays only the process ID (PID) of each job.|
||Displays only running jobs.|
||Displays only suspended jobs.|
- If the
jobscommand does not display any output, it means that there are no jobs currently running in the background or suspended.
- If you are unable to identify a specific job using the job number, it may have already completed or been terminated.
- If the
jobscommand is not working as expected, try using the
pscommand to display a list of all running processes and their status.
jobscommand only displays the status of jobs that are started in the current shell session. If you start a job in a different shell session, it will not be displayed in the output of the
- The job number is assigned based on the order in which jobs are started. The first job that is started will have a job number of
1, the second job will have a job number of
2, and so on.