Want to display the files in a Linux folder sorted by date, with the oldest first and the newest at the bottom (and therefore just above your command line once the command is executed)? It’s very simple.
It barely warrants an article, but since it’s a command that can turn out to be very useful, I thought it was worth putting it here anyway.
You all know the ls command which allows you to have the contents of a Linux folder, we will simply play on the options of this command line by adding the parameter l (to have the details of the rights), a (to have all files even hidden ones), t (to sort by date and not file name) and r (to sort backwards). Or the following command:
ls-lart
Useful for example to see the last log that moved in the log folder.