How can I sort the output of 'ls' by last modified date?
How can I sort the output of ls
by last modified date?
ls -t
or (for reverse, most recent at bottom):
ls -tr
The ls
man page describes this in more details, and lists other options.
Try this: ls -ltr
. It will give you the recent to the end of the list
For a complete answer here is what I use: ls -lrth
Put this in your startup script /etc/bashrc
and assign an alias like this: alias l='ls -lrth'
Restart your terminal and you should be able to type l
and see a long list of files.