I know some useful Bash shell shortcuts, and I am wondering if there are others. The ones I know:

  • CTRL + W: delete until beginning of word
  • CTRL + U: delete until beginning of line
  • Up / Down: navigate between previous commands

What I am especially curious are the following:

  • deleting until first "/" symbol or until the point CTRL + Left would go back
  • Searching in previous posts

And any other useful shortcuts, if any.

link|improve this question

feedback

closed as not constructive by Sathya Mar 5 at 11:44

This question is not a good fit to our Q&A format. We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion. See the FAQ for guidance on how to improve it.

4 Answers

up vote 5 down vote accepted

All this can be found in the bash man page (or type man bash in a shell)

Info per section:

and some more

link|improve this answer
feedback

The keyboard shortcuts available to you depend on whether you're using bash in emacs mode (the default) or in vi mode. You can find out which mode you're using by executing

set -o

Look in the resulting list for the line beginning "vi" and see if it is "on" or "off". Then execute

man bash

and read the section on READLINE. There you will find description of at least those commands (what you call shortcuts) available in emacs mode.

link|improve this answer
feedback

Yyou can undo tab completion with Esc Backspace.

link|improve this answer
Do you mean Esc or do you mean Backspace or do you mean pressing both? – Tom Wijsman Mar 5 at 0:43
feedback

Alt+. to insert the last argument of the previous command.

Ctrl+r to search your history (though it's flaky)

History expansion in general (using !)

link|improve this answer
feedback

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