DEV Community

My Favorite Command-Line Shortcuts

Henrik Warne on August 11, 2018

I use a shell every day. Almost always, I want to repeat a previous command, or repeat it after a slight modification. A very convenient way is t...
Collapse
 
caseywebb profile image
Casey Webb

Runs command

Requires sudo

sudo !!

Collapse
 
matt123miller profile image
Matt Miller

I use this daily since discovering it! Especially now I'm using Ubuntu at home and they want sudo for everthing...

Collapse
 
jianfangbh profile image
J. Bladen-Hovell

escape-dot, !$, ctrl-w are useful.Thanks.

Collapse
 
stealthmusic profile image
Jan Wedel

I love keyboard shortcuts so thanks for sharing! And you’re right, I knew all of those you mentioned except for the ESC/dot. :) will try that ASAP

Collapse
 
stealthmusic profile image
Jan Wedel

That's pretty awesome. I didn't even know that there is even a concept of two consecutive key strokes forming a short cut...

Collapse
 
nebojsac profile image
Nick Cinger

Nice tips! Adding that alias to my collection :D

Thanks for sharing!

Collapse
 
sandydamy profile image
Sandesh Damkondwar

Up arrow works same way in iterm. :)