Skip to content

Instantly share code, notes, and snippets.

@doctorallen
Created April 17, 2014 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctorallen/10986671 to your computer and use it in GitHub Desktop.
Save doctorallen/10986671 to your computer and use it in GitHub Desktop.
List all directories by the timestamp of all files recursively
#!/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