Our thinking


Display most recently modified files in a folder, and all subfolders, using Terminal

I recently needed to search through a fairly extensive list of files to find when the most recently modified files were last edited, and needed to search in a folder and all subfolders.

This one-liner did the trick for me – change the head -20 at the end to a different number to see that number of most recently modified files.

find . -type f -exec stat -f "%Sm %N" -t "%Y-%m-%d %H:%M:%S" {} + | sort -r | head -20

Leave a Reply