Linux. how to find the most recent file in a folder dandelion 6 years ago find $DIR -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2- | tail -n 1 Found at StackOverflow.