From time to time, you'll submit an at job and realize that there's something wrong with it. How do you get it out of the queue? Two tools help you do this: atq, which reports the jobs that are in the queue, and atrm, which deletes jobs that are already in the queue.
atq is pretty simple; by default, it reports on all jobs that have been queued. Optionally, you can give it a user name as an argument; in this case it reports all the jobs queued by the given user. The report looks like this:
atqRank Execution Date Owner Job # Queue Job Name 1st Oct 9, 1996 22:27 mikel 4637 a stdin 2nd Oct 10, 1996 01:08 mikel 4641 a stdin 3rd Oct 10, 1996 02:34 judy 4663 a stdin
Note that atq has no objection to telling you about other users' jobs. Although this might seem like a security hole, it's actually useful - see article 40.5. The jobs are ordered according to their execution date. With the -c option, atq orders jobs according to when they were queued - conceivably a useful feature. (atq - n just prints the number of jobs that are queued; I'm not sure when this would be useful.)
atrm 46374637: removed %
atrm 46634663: permission denied
The command atrm - removes all the jobs you submitted; it's good for cleaning out your queue completely.
Some older BSD-based implementations may not support any of these options. Once you submit a job, you can delete it by finding its filename in the /usr/spool/at directory and. Or the can go to the spool directory and delete the file by hand.