Created
June 14, 2012 21:07
-
-
Save landon9720/2932955 to your computer and use it in GitHub Desktop.
the most recent file in the current directory is ...
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
#!/bin/bash | |
ls -lrt | awk '{ f=$NF }; END{ print f }' |
This alias works well, too:
alias lastf="ls -lrt | awk '{ f=$NF }; END{ print f }'"
That's awesome! Thanks. How did you find this?
It was a public gist and was under the "All Gists" list.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why not just
ls -t | head -1