Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using

atq

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

share|improve this question

1 Answer 1

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|improve this answer
    
thanks this is what i want –  bob Nov 26 '12 at 7:36

Your Answer

 
discard

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.