+1 vote
in Operating Systems by (3.8k points)

How can I sort the output of the Linux ls command by date and time?

1 Answer

0 votes
by (17k points)

Use 'ls' command with the option '-lt' to sort its output by the modification date and time of files/directories.

$ ls -lt

If you want to reverse the order of the sorting, use the option '-ltr'.

-t                         sort by modification time, newest first
-r, --reverse              reverse order while sorting
 

...