Skip to content

Instantly share code, notes, and snippets.

@mcnemesis mcnemesis/last_log
Created Apr 11, 2019

Embed
What would you like to do?
for those times you need a handy utility to preview logs on the way to doing other things...
# nuchwezilabs ## for those times you need a handy utility to preview logs on the way to doing other things...
#alias lastlog="tail -n 20 $(ls -d -t -1 "$PWD/logs/"** | sed -n '2p')"
#nu method...
function lastlog() {
tail -n 20 $(ls -d -t -1 $(pwd)/logs/** | sed -n '2p')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.