Skip to content

Instantly share code, notes, and snippets.

@shollingsworth
Created October 12, 2014 15:58
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 shollingsworth/f34205663345e2b31682 to your computer and use it in GitHub Desktop.
Save shollingsworth/f34205663345e2b31682 to your computer and use it in GitHub Desktop.
bash find files in current directory sorted by last modified time
#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