How can I list my `at` jobs by date?

16,635

You can pipe the output of atq to sort and use the k switch (sort via key) and M (month-sort) to list your jobs by date. For example, the default output would look like:

atq
5   Mon Dec 10 19:00:00 2012 a jason
6   Tue Jan 15 05:00:00 2013 a jason
4   Thu Dec  6 19:00:00 2012 a jason

Piping through sort:

atq | sort -r -k3M -k4
6   Tue Jan 15 05:00:00 2013 a jason
5   Mon Dec 10 19:00:00 2012 a jason
4   Thu Dec  6 19:00:00 2012 a jason

Where the third field is sorted by month (-M) and the fourth field by day. You could also sort by any of the other fields, like the time, by adding another key.

Share:
16,635

Related videos on Youtube

WAEL
Author by

WAEL

Updated on September 18, 2022

Comments

  • WAEL
    WAEL almost 2 years

    I am using

    atq

    command, but I need to list my at jobs by date. How is that possible ?