Not really code, but still something I need often enough to write it down.
This command will list all files in a Linux folder sorted by date with the most recently updated files at the bottom.
From the ls man page, here’s what each of the choices do.
-l – Uses a Long format which shows more information on each file
-t – Sorts by modification time
-r – Reverse order. Without this the most recently updated files would be at the top of the list instead of the bottom.
-h – Human friendly file sizes. Shows files in KB, MB, or GB instead of just bytes.