Skip to content

last file created in directory

yvan edited this page Mar 18, 2015 · 4 revisions

from http://stackoverflow.com/questions/4561895/how-to-recursively-find-the-latest-modified-file-in-a-directory

find . -type f -exec stat -f "%m %N" {} ; | sort -n | tail -1 | cut -f2- -d" "

this need to be check

On loki :

find . -type f -exec stat --format "%n %y" {} \; |sort -k2 |tail -n 10 |cut -d' ' -f1

Clone this wiki locally