Ask your questions here.
Post a reply

bash command line shortcuts

Mon Mar 25, 2013 8:27 am

There probably is a cheatcode somewhere.
I need a few tricks only.

Jump to
end of line
beginning of line
end of word
beginning of word

Delete:
to end of line
to beginning of line
next word
previous word

-
As of now i was not able to figure out when to use
alt
and when to use
ctrl
Is there any concept, or is it arbitrary?

Re: bash command line shortcuts

Mon Mar 25, 2013 1:36 pm

Here it is. I knew I'd seen it before, and I found it pretty quickly.
http://www.gnu.org/software/bash/manual ... ne-Editing

Re: bash command line shortcuts

Mon Mar 25, 2013 7:47 pm

Good, it has all i need.
Thanks

Let me safe it here
(safe must be save, so let me save that here too, in case i need to check it sometimes).
ctrl+e #jump to end of line
ctrl+a #jump to beginning of line
alt+b #jump a word back
alt+f #jump a word forward

ctrl+k #delete all until end of line
alt+d #delete to end of word
alt+del #delete to beginning of word
ctrl+w #delete to beginning of word
ctrl+u #clear actual line

ctrl+l #clear screen

For the life of me i see no rule when to use ctrl and when to use alt.

-
Let me add two other tricks i know and use regulary:
!$
The last argument of the previous command
mkdir ~/Tmp/foobar
cd !$
will cd to ~/Tmp/foobar

^prev cmd^replacement^
mkdur foobarbaz
^mkudr^mkdir^

I think that should take me a long way. But i am open for more tricks.

Re: bash command line shortcuts

Tue Mar 26, 2013 12:44 am

"alt+f #jump a word forward"

Nope. That doesn't work here, alt-shift-f does it.

I didn't test everything.

Edit: It doesn't work in xfce4-terminal. alt-f opens the File menu. It does work in console, where there are no menus to open.

Edit2:
Code:
cd -
Change to previous directory.
Post a reply