List files sorted by modification time
List files newest first with ls -t and oldest first with ls -tr. The sort uses the modification time, and the long listing shows the times it sorted by.
You want the most recently changed file at the top of a listing, or at the bottom, where it stays on screen.
touch -d '2026-01-01 10:00' old
touch -d '2026-03-01 10:00' middle
touch -d '2026-06-01 10:00' new
ls -t
echo ---
ls -tr
echo ---
ls -lt --time-style=long-isonew
middle
old
---
old
middle
new
---
total 0
-rw-r--r-- 1 root root 0 2026-06-01 10:00 new
-rw-r--r-- 1 root root 0 2026-03-01 10:00 middle
-rw-r--r-- 1 root root 0 2026-01-01 10:00 old-t sorts by modification time, newest first, and -r reverses whatever order is selected, so -tr puts the newest last, as the coreutils manual describes. The long format with --time-style=long-iso prints the exact date the sort used, which makes it easy to see that the order and the dates agree.
A directory's modification time changes when an entry is added or removed, not when a file inside it is edited, so sorting directories this way answers a different question than sorting files. Files with the same time are ordered by name. -u sorts by access time and -c by change time. Time styles are a GNU option; BSD ls uses -D.