The status and other information about all jobs is displayed using the jobs command. The following jobs output shows that there is one stopped job, and two running jobs. The + indicates the current job, and ?/span> indicates the previous job: $ jobs [3] + Stopped split ?000 hugefile [2] ?Running find / name core print & [1] Running sleep 25 & The jobs l command shows the same information, along with the process ids, while jobs p only gives you the process ids. $ jobs l [3] + 466 Stopped split ?000 hugefile [2] ?465 Running find / name core print & [1] 463 Running sleep 25 & Killing Jobs Stopped or background jobs are terminated with the kill command. Unlike bg or fg, a job argument must be given. Here, a sleep command is put in the background, then killed: $ sleep 100 & [1] 254 $ kill %1 It could also be given as kill 254. Waiting for Jobs You can make the Korn shell wait for some or all background jobs to complete with the wait command. If no argument is given, the Korn shell waits for all background jobs to complete. |