Skip to content

Instantly share code, notes, and snippets.

@beezly
Created September 14, 2012 14:17
Show Gist options
  • Save beezly/3722171 to your computer and use it in GitHub Desktop.
Save beezly/3722171 to your computer and use it in GitHub Desktop.
Monstrosity
find -type f -exec ls -E {} \; | awk '{ print $9 " " $6 " " $7 }' | awk -F/ '{ print $3 " " $2 }' | sort -n > s ; for i in `awk '{ print $1 }' < s | uniq`; do cp -p `grep "^$i" s | awk '{ print $2 " " $3 " " $4 }' | sort -n | tail -1 | awk '{ print $3 }'`/$i out/; done
@beezly
Copy link
Author

beezly commented Sep 14, 2012

Make sure you scroll across to see the whole lot, or click raw.

@beezly
Copy link
Author

beezly commented Sep 14, 2012

It's also worth knowing that this was written with Solaris in mind. ls -E is similar to ls --full-time on Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment