I'm used to using the unix shell where when I write the beginning of a command (say ca) and hit the up arrow, I will only get commands in history that begin with "ca". In my current shell (brand new ubuntu) when I hit the up arrow I always get the previous command... Also, here typing Ctrl-P doesn't move me to the previous word... How can I get the shell that does?

link|improve this question
feedback

migrated from stackoverflow.com Jun 3 '11 at 8:35

This question came from our site for professional and enthusiast programmers.

2 Answers

For the history-search enter this into your ~/.inputrc

"\M-[A":history-search-backward
"\M-[B":history-search-forward
link|improve this answer
+1, indispensable. – l0b0 Jun 3 '11 at 13:51
feedback

You probably want to use bash.

link|improve this answer
1  
Neither of the behaviors the OP lists are bash defaults. – dmckee Jun 2 '11 at 20:33
Hi, thanks for the response. I am using bash, I also tried tcsh but I get the same results. Do I need some switches for this? – ido Jun 2 '11 at 20:34
You probably just need the correct settings in your inputrc file, as described here – Pumbaa80 Jun 2 '11 at 20:54
I am now on my "good" machine, and didn't find the inputrc file, even after grep-ing throughout and also tried to find the setting "history-search-backward"... is there another place I should look for the settings? – ido Jun 7 '11 at 7:04
feedback

Your Answer

 
or
required, but never shown

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