Search for a previously run command
history | grep <pattern>
Repeat Last Command
Repeating the most recent command
UP arrow then ENTER
Repeat Last Command Starting With …
Reopen the last file with
vim that contains a long filename which you can’t remember
If you want to be sure that the last command starting with
v is indeed
vim and not
vscode (Ugh) then you can examine to make sure the last
command was OK.
Repeat the Last Command With New Arguments
ls foo ls bar
ls foo !!:0 bar
Repeat Last Arguments With New Command
vim /tmp/foo.txt emacs /tmp/foo.txt
vim /tmp/foo.txt ^vim^emacs
Hold Result Of Command
find . -name "blahblah.txt" # found in here/there/everywhere/blahblah.txt rm here/there/everywhere/blahblah.txt
rm `find . -name "blahblah.txt"` # same as rm $(find . -name "blahblah.txt")
If you like topics such as this then please consider subscribing to my podcast. I talk to some of the stalwarts in tech and ask them what their favorite productivity hacks are:
Available on iTunes Podcast
Visit Void Star Podcast’s page on iTunes Podcast Portal. Please Click ‘Subscribe’, leave a comment.
Available on Google Play Music
Visit Void Star Podcast’s page on Google Play Music. Please Click ‘Subscribe’ and leave a comment.
Available on Stitcher
Visit Void Star Podcast’s page on Sticher. Please Click ‘Subscribe’ and leave a comment.
Your app not listed here? Not an issue..
You should be able to search for ‘VoidStar Podcast’ on your favorite app.
Most apps use one of the above sources for listing podcasts. This was tested on
Podcast Addict (where you can also specify the search engine) and
RatPoison on Android.