How to sort files in Linux in date order

Use the following flags with ‘ls’ to control the directory date sort order:
ls -lat
-l is for long style
-a is for all (including hidden files)
-t is to specify that want ordered by date
That above example will show the dates in reverse date order. To see in forward date order, do this:
ls -latr

That will do the opposite


Share this article

Scroll to Top