licoded / self-study-drafts

buffer for records
0 stars 0 forks source link

Utility Script: find newest file in directory recursively #167

Open licoded opened 10 months ago

licoded commented 10 months ago

reference link: How to recursively find and list the latest modified files in a directory with subdirectories and times

#!/bin/bash
find $1 -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut -d: -f2- | head