søren peter mørch

Conversation

Recent posts in reply to #xfrwj3q

aelaraji (aelaraji.com)

Just discovered how easy it is to recall my last arg in shell and my brain went 🤯 How come I've never learned about this before!? I wonder how many other QOL shortcuts I'm missing on 🥲

Read replies 4 months ago
prologic (twtxt.net)

@aelaraji You mean Control R?

In reply to: #xfrwj3q 4 months ago
bender (twtxt.net)

@prologic no, good man. Follow the link, follow eet! :-)

In reply to: #xfrwj3q 4 months ago
movq (www.uninformativ.de)

@aelaraji I use Alt+. all the time, it’s great. 👌

FWIW, another thing I often use is !! to recall the entire previous command line:

$ find -iname '*foo*'
./This is a foo file.txt

$ cat "$(!!)"
cat "$(find -iname '*foo*')"
This is just a test.

Yep!

Or:

$ ls -al subdir
ls: cannot open directory 'subdir': Permission denied

$ sudo !!
sudo ls -al subdir
total 0
drwx------ 2 root root  60 Jun 20 19:39 .
drwx------ 7 jess jess 360 Jun 20 19:39 ..
-rw-r--r-- 1 root root   0 Jun 20 19:39 nothing-to-see
In reply to: #xfrwj3q 4 months ago
aelaraji (aelaraji.com)

@movq I'm feeling SO dumb right now 😅 I used to think !! was a sudo argument and never used it out of that context! Thanks for the $(!!) tip 🤘

In reply to: #xfrwj3q 4 months ago
Reply via email