Guillaume Hérail

Ramblings in Frenglish

Find oldest files in a directory recursively

Posted on — Jan 10, 2021

Small post today, just a command. I’ll start posting commands I’ve found useful under the commands tag.

Example to find the top 5 oldest files that are named *index recursively in a directory:

find /path/to/directory -name '*index' -type f -printf '%T+ %p\n' | sort | head -n 5

This is day 8/100 of #100DaysToOffLoad!