1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-07 00:58:02 +00:00

Add Last Argument Of The Last Command as a unix til

This commit is contained in:
jbranchaud
2016-02-29 22:32:28 -06:00
parent 883743b026
commit ba686ab4e0
2 changed files with 27 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
# Last Argument Of The Last Command
You can use `!$` as a way to reference the last argument in the last
command. This makes for an easy shortcut when you want to switch out
commands for the same long file name. For instance, if you just ran `cat` on
a file to see its contents
```bash
$ cat /Users/jbranchaud/.ssh/config
```
and now you want to edit that file. You can just pass `!$` to the `vim`
command:
```bash
$ vim !$
```
Hit enter or tab to get the full command:
```bash
$ vim /Users/jbranchaud/.ssh/config
```
h/t Dorian Karter