alt-. also pastes the last argument of the previous command (useful if you need to modify it a bit)
instead of any shortcuts starting with “alt” you can also press “esc” followed by the second key, e.g. pressing “esc”, releasing it and then “a” is the same as pressing “alt-a” (useful if you have only one hand available, or if alt is not availalble)
if you put a space before a command, it will not be saved in history (useful sometimes, e.g. if you pass a password directly as an argument)
Explains why they are so illogical! Unfortunately i think its better to just learn the defaults since i remote into lots of servers where i dont carry my config
sudo !!
which foo
tells you where thefoo
program is locatedls -la
cd
without any args takes you to your home dircd -
takes you to your previous dirNice list, TIL about
Ctrl+U
andCtrl+Y
.If I may add,
Ctrl+X
intoCtrl+E
opens$EDITOR
to edit the current line.Makes me realize just how illogical and bad these shortcuts are
I believe, these are Emacs shortcuts. There’s also
set -o vi
in bash, but I’ve never used it, so can’t vouch for it.Explains why they are so illogical! Unfortunately i think its better to just learn the defaults since i remote into lots of servers where i dont carry my config
I’ve been using the commandline for so long but was always too lazy to look up the rest of these commands after ctrl+a/e and ctrl+r THANK YOU!!!
post this commend again and again! There’s always lazy idiots like me who will be helped that way!