Created
October 12, 2014 15:58
-
-
Save shollingsworth/f34205663345e2b31682 to your computer and use it in GitHub Desktop.
bash find files in current directory sorted by last modified time
This file contains 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
#find and sort by modified time | |
find . -type f -printf "%T@::%t::%p\n" | sort -n | |
#Grab the last 5 modified files | |
find . -type f -printf "%T@::%t::%p\n" | sort -n | awk -F '::' '{print $3}' | tail -n5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment