Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List and kill at jobs on UNIX

I have created a job with the at command on Solaris 10.

It's working now but I want to kill it but I don't know how I can find the job number and how to kill that job or process.

like image 769
soField Avatar asked Dec 01 '09 11:12

soField


People also ask

How do I kill a specific job in UNIX?

You can terminate Unix jobs in different ways. A simple way is to bring the job to foreground and terminate it, with control-c for example. If the -2 signal does not work, the process may be blocked or may be executing improperly. In this case, use -1 (SIGHUP), -15 (SIGTERM), and then at last resort -9 (SIGKILL).

How do I list all jobs in Linux?

To list processes in Linux, use one of the three commands: ps, top or htop. Ps command provides static snapshot of all processes, while top and htop sorts by CPU usage.

How do you kill a batch job in UNIX?

Use the Task Manager to end the statisticsb.exe process. UNIX. Find the process ID of the batch job (for example, use the ps -ef command at the UNIX prompt) and then kill the process (for example, use kill pid at the UNIX prompt).


1 Answers

To delete a job which has not yet run, you need the atrm command. You can use atq command to get its number in the at list.

To kill a job which has already started to run, you'll need to grep for it using:

ps -eaf | grep <command name>

and then use kill to stop it.

A quicker way to do this on most systems is:

pkill <command name>
like image 165
Benj Avatar answered Oct 29 '22 20:10

Benj