Skip to content

Instantly share code, notes, and snippets.

@lukmdo
Last active December 11, 2015 15:59
Show Gist options
  • Save lukmdo/4624695 to your computer and use it in GitHub Desktop.
Save lukmdo/4624695 to your computer and use it in GitHub Desktop.
Bash - last command args shortcut
$ echo a b c d
a b c d
# PCA. - meaning previous command argument
$ echo !* ; # !* is all PCA == echo a b c d
a b c d
$ echo !^ ; # !^ is first PCA == echo a
a
$ echo !$ ; # !$ is last PCA == echo d
d
$ echo !:2 ; # !:N is N'th PCA ie. !:2 == echo b
b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment