Skip to content

Instantly share code, notes, and snippets.

@ksaj
Created June 30, 2020 05:23
Show Gist options
  • Save ksaj/f3bdcc102af469abc7d47dbd9e158f92 to your computer and use it in GitHub Desktop.
Save ksaj/f3bdcc102af469abc7d47dbd9e158f92 to your computer and use it in GitHub Desktop.
A bash shortcut that blew my mind
Bash users already know you can !$ to run a different command with previous args.
-> ls text.txt ; less !$ # becomes *less text.txt*
Today I discovered $:0
-> ls text.txt ; $:0 less # becomes *less text.txt*
Mind. Blown!
-- Karsten Johansson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment