Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With fish-shell, if I type a few words of a ran command, I will get a prompt of the whole command line. Then I just use Right Arrow key to complete the whole line.

But on other things, fish-shell sucks. So how could I do this prompt thing in bash?

share|improve this question
up vote 2 down vote accepted

There is no way for bash to automatically fill in the command line from history. Performing reverse-search-history, bound to CtrlR by default, will allow you to type in part of a command which bash will then attempt to find in history. Performing it while doing a search will find older matches.

share|improve this answer
I see. Alright then. Thank you. – Magicloud Oct 15 '13 at 5:38

Yes. It is a way activate a search for command from history. I also like this kind of things in tcsh. To retrieve your last commands from history you should: 1) add file .inputrc in your home directory 2) restart shell 3) start typing beginning of your last wanted command 4) and then hit ESC+p or ESC+n

~/.inputrc should be like this:

### tcsh behavior in bash:

### ESC+p and ESC+n (or M+p and M+n) will give non-increment history

### completion backwards and forward, respectively

"\ep": history-search-backward

"\en": history-search-forward

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .