Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Shells: User's Guide: HP 9000 Computers > Chapter 22 Controlling Jobs

Killing Jobs

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Sometimes after you've started a job and placed it in the background, you realize it is an incorrect process and you do not want to run it. In this type of instance, you can destroy or kill a job.

Suppose, you start this process:

$ lsf /* | sort > filenames&
[1] 6112

then realize you do not want to list the full file system (that is, you really didn't want to use * in the command line), but rather, just the root directory, and decide to kill the job. To kill the process, use the job's number, ([1]), and type:

$ kill %1
$

The kill command kills the job and the % metacharacter specifies the job number 1. As shown above, you are returned to the prompt. Recall that %+ and %% perform the same function as %1, since it is the current job. If it was the previous job, use %-. To see the status of the job, type:

$ jobs
[1] + Terminated lsf /* | sort > filenames&

The line following jobs shows that the current lsf job has been terminated.

If you log off the system while any of your processes are running, whether in background or foreground, the jobs are destroyed unless you use the nohup command (see nohup(1) in the HP-UX Reference for details).

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-1991 Hewlett-Packard Development Company, L.P.