17 Sep

Linux. how to find the most recent file in a folder

find $DIR -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2- | tail -n 1

Found at StackOverflow.



Leave a Reply

Your email address will not be published. Required fields are marked *