Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Debian box with some jobs scheduled using at. I know I can list the jobs with their times using atq, but is there any way to print out their contents, apart from peeking into /var/spool/cron/atjobs?

share|improve this question
up vote 13 down vote accepted

at -c jobnumber will list a single job. If you want to see all of them, you might create a script like

MAXJOB=$(atq | head -n1 | awk '{ print $1; }')
for each in $(seq 1 $MAXJOB); do echo "JOB $each"; at -c $each; done 

Probably there's a shorter way to do that, I just popped that out of my head :)

share|improve this answer
at -c $(atq | cut -f 1) or for each in $(atq | cut -f 1) will avoid "Cannot find jobid" errors. (Also, Bash has for ((each=1; each<=MAXJOB; each++)) so no need for seq. If you're concerned with portability, then #!/bin/sh.) – Dennis Williamson Aug 26 '10 at 15:08

A much simpler approach:

for j in $(atq | cut -f 1); do at -c "$j"; done

You could also look at each one in less in turn, which might be clearer:

for j in $(atq | cut -f 1); do at -c "$j" | less; done
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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