Skip to content

Instantly share code, notes, and snippets.

@bogstandard
Created October 14, 2018 02:16
Show Gist options
  • Save bogstandard/8d5fa53c4e23ada73b31494ad783b8f6 to your computer and use it in GitHub Desktop.
Save bogstandard/8d5fa53c4e23ada73b31494ad783b8f6 to your computer and use it in GitHub Desktop.
open Nth most recent file in current directory
# opens nth most recent file in current working directory
# use: nthrecent 5
function nthrecent() {
( open "`ls -t . | head -n$1 | tail -n1`" )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment