- Published on
jobs command-Display job information of the shell
Jonas
1 min read
The jobs command is mainly used to display the list of tasks in the system and their running status.
This command can display the task number and its corresponding process number. The task number is from the perspective of ordinary users, and the process number is from the perspective of system administrators. A task can correspond to one or more process numbers.
Syntax: jobs [parameter] [directory]
Command parameters
-l | Include process number when displaying job list |
-n | Display the jobs whose status has changed since the last use of jobs |
-p | When displaying the job list, only the corresponding process number is displayed |
-r | Show only running jobs |
-s | Show only stopped jobs |
Example
Display the current job list:
[root@linuxstar ~]# jobs
Display the current job number and the corresponding process number:
[root@linuxstar ~]# jobs -l
Show only running jobs:
[root@linuxstar ~]# jobs -r
Show only suspended jobs:
[root@linuxstar ~]# jobs -s
Display the jobs whose status has changed since the last use of jobs:
[root@linuxstar ~]# jobs -n