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.

When I need to find my recently used files, this command:

ls -lt

lists in ascending order (by time), when there are lots files, I need to scroll to the top to see needed files, because wont fit in terminal screen.

After finding out that tac inverses the output, I use: ls -lt dir/ | tac Is there more fun way of doing it, without using external scripts/utils?

share|improve this question
    
You could try ls -lt | less or ls -lt | head -n 5. –  RanRag Nov 7 '12 at 18:35

1 Answer 1

The -r does the same thing for ls as tac does for any command which needs reverse file ordering.

So you could just write

ls -ltr
share|improve this answer
1  
Thanks! Used ls for ages and never new there's -r :p –  linux-newbie Nov 7 '12 at 18:46
    
This is remembered with the handy mnemonic "later". As in, "I want to see the files that were changed later: ls -ltr" –  bahamat Nov 7 '12 at 20:16

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.