Let's talk about sorting the output of the ls command by timestamp. 1
This is a common task. 2
By default, the ls -l command is showing the modification time, 3
this is the modification time for each file, and sorting the output by name and the ls command is listing 4
the files in alphabetical order. 5
If you want to sort by modification time at the -t option, it will display the output 6
sorted by modification time, newest files first. 7
They are sorted by modification time. If to -t option, you add the -u option, then 8
it will sort by and show access time. It's sorting by and showing access time. 9
The same option -u with l will show the access time and sort the file of by name. 10
This is the access time and the files are sorted by name, in alphabetical order. 11
If you want to reverse the order of sorting add the -r or the -- reverse option like 12
this: 13
-r or --reverse. It's showing and sorting by access time in reverse order. 14
Note that you can group -r with other options. 15
Or use the long option format instead.