I know that to remove a scheduled at job I have to use atrm "numjob1 numjob2", but is there an easy way to do that for all the jobs?


You can run this command to remove all the jobs at the atq

 for i in `atq | awk '{print $1}'`;do atrm $i;done
  • 1
    variation on this answer at -l | awk '{printf "%s ", $1}' | xargs atrm – Sergiy Kolodyazhnyy Apr 24 '15 at 10:11

You could do something like this:

for i in $(atq | cut -f 1); do atrm $i; done
  • In FreeBSD it's cut -f3 First column is date – David Jashi Oct 26 '14 at 9:51

This seems to me a short line:

atrm $(atq | cut -f1)

For more AIX 6 systems you can simply do:

atrm -

Ref: http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.cmds%2Fdoc%2Faixcmds1%2Fatrm.htm


Here is my xargs version that avoids braces and is hopefully intuitive:

atq | cut -f 1 | xargs atrm

You can also grep specific jobs by timestamp/userid and then remove them:

atq | grep "2018-10-22 16:" | cut -f 1 | xargs atrm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.