Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Linux jobs command

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of how to use the Linux jobs command, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this Linux jobs command article. Let's take a look at it.

The Linux common command jobs command is mainly used to display the status of the job.

Jobs displays the status of the job.

Summary jobs [- lnprs] [jobspec.] Jobs-x command [args] the main purpose is to display the status of the job.

Lists the active assignments.

Lists jobs that are stopped.

The option-l lists the PID additionally in the job information. -n lists only jobs whose status has changed since the last notification. -p lists only PID. -r outputs only jobs that are running. -s outputs only jobs that are in a stopped state. The return status is successful unless an illegal option is given and an error occurs in the execution.

If executed in the form of jobs-x command [args], the return value is the exit status of command.

Example [user2@pc] ssh 192.168.1.4 pc@192.168.1.4's password: # Press ctrl+z at this time to stop the interaction. [1] + Stopped ssh 192.168.1.4 [user2@pc] sleep 60 & [2] 13338 [user2@pc] jobs [1]-Stopped ssh 192.168.1.4 [2] Running sleep 60 & [user2@pc] jobs-l [1]-12927 Stopped ssh 192.168.1.4 [2] 13338 Running Sleep 60 & [user2@pc] jobs-p 12927 13338 [user2@pc] jobs-s [1]-Stopped ssh 192.168.1.4 [user2@pc] jobs-r [2] Running sleep 60 & [user2@pc] kill-9 12927 [2] Done sleep 60 [user2@pc] jobs-n-l [1] + 12927 Killed Ssh 192.168.1.4 [user2@pc] jobs-n-l Note bash's job control commands include bg fg kill wait disown suspend.

This command needs to be executed when the set option monitor is on; to view the job control status: type set-o to view the monitor line; execute set-o monitor or set-m to turn on this option.

This command is a bash built-in command. For help, please see the help command.

This is the end of the article on "how to use the Linux jobs command". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use Linux jobs commands". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report