Skip to content

Instantly share code, notes, and snippets.

@adamesque
Created October 17, 2011 02:01
Show Gist options
  • Select an option

  • Save adamesque/1291770 to your computer and use it in GitHub Desktop.

Select an option

Save adamesque/1291770 to your computer and use it in GitHub Desktop.
Bash alias to get the last modified file in a directory
# Naive NOT-FOR-PRODUCTION method. Fails for filenames that contain newlines.
alias lastmod="ls -t | head -n 1"
@adamesque

Copy link
Copy Markdown
Author

Ha! You know, I really ought to know better; I fixed that exact same bug in node: nodejs/node-v0.x-archive@7f30f13

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