Created
April 17, 2014 14:14
-
-
Save doctorallen/10986671 to your computer and use it in GitHub Desktop.
List all directories by the timestamp of all files recursively
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for dir in */; do | |
timestamp=$(find ./$dir -type f -printf "%T@ %t\\n" | sort -nr -k 1,2 | head -n 1) | |
printf "%s %s\n" "$timestamp" "$dir" | |
done | sort -nr -k 1,2 | awk '{$1=""; print}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment