Listing files by date.

The -t option to the ls command list files from newest to oldest. Use the -roption with the -t option to reverse the order and list files from oldest to newest. Add the -u option to sort by access time rather than modification time.

-l (long file listing) option to display the modification time
ls -lt
List most recently modified files first.
$ls -lt
total 272
drwxrwsr-x 12 kippecd kipped 12288 Jan 27 16:44 data
drwxrwsr-x 4 kippecd kipped 4096 Jan 27 16:12 ftp
drwxrwsr-x 2 thompsl2 kipped 86016 Jan 21 10:47 temp
drwxrwsr-x 2 thompsl2 kipped 28672 Oct 9 08:53 tmp
drwxrwsr-x 11 kippecd kipped 4096 Jul 16 2003 logs
$

ls -ltr
List files from oldest to newest according to modification time.
$ls -ltr
total 272
drwxrwsr-x 11 kippecd kipped 4096 Jul 16 2003 logs
drwxrwsr-x 2 thompsl2 kipped 28672 Oct 9 08:53 tmp
drwxrwsr-x 2 thompsl2 kipped 86016 Jan 21 10:47 temp
drwxrwsr-x 4 kippecd kipped 4096 Jan 27 16:12 ftp
drwxrwsr-x 12 kippecd kipped 12288 Jan 27 16:44 data

 

ls -tu
List most recently accessed files first.
ls -tru
List files from oldest to newest according to access time.