Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Other than Ctrl+{k, u, a, e}, what other emacs shortcuts are worth remembering and useful in the Terminal?

share|improve this question

closed as not constructive by slhck, sblair, Sathya Nov 2 '11 at 14:10

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Emacs keybindings are not specific to a terminal, they are used by the shell, most prominently Bash, which uses the GNU Readline library to read input. –  slhck Nov 1 '11 at 23:09
    
Also see: Bash Emacs Editing Mode Cheat Sheet. –  slhck Nov 1 '11 at 23:20
    
As a vi user, I find no emacs shortcuts are worth remembering :-) set -o vi! –  RedGrittyBrick Nov 2 '11 at 9:53

1 Answer 1

up vote 1 down vote accepted

It would be difficult to say which shortcuts are worth remembering for you, it is entirely dependent on your workflow. Here is a selection you can go through to decide for yourself:

Ctrl-a  Move to the start of the line.
Ctrl-e  Move to the end of the line.
Ctrl-b  Move back one character.
Alt-b   Move back one word.
Ctrl-f  Move forward one character.
Alt-f   Move forward one word.
Ctrl-] x    Where x is any character, moves the cursor forward to the next occurance     of x.
Alt-Ctrl-] x    Where x is any character, moves the cursor backwards to the previous occurance of x.
Ctrl-u  Delete from the cursor to the beginning of the line.
Ctrl-k  Delete from the cursor to the end of the line.
Ctrl-w  Delete from the cursor to the start of the word.
Esc-Del     Delete previous word (may not work, instead try Esc followed by Backspace)
Ctrl-y  Pastes text from the clipboard.
Ctrl-l  Clear the screen leaving the current line at the top of the screen.
Ctrl-x Ctrl-u   Undo the last changes. Ctrl-_ does the same
Alt-r   Undo all changes to the line.
Alt-Ctrl-e  Expand command line.
Ctrl-r  Incremental reverse search of history.
Alt-p   Non-incremental reverse search of history.
!!  Execute last command in history
!abc    Execute last command in history beginning with abc
!abc:p  Print last command in history beginning with abc
!n  Execute nth command in history
!$  Last argument of last command
!^  First argument of last command
^abc^xyz    Replace first occurance of abc with xyz in last command and execute it
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.