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?


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.


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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