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

In some linux systems, when I write the beginning characters of a command and press page-up, I can browse through the latest similar commands saved in the history file. However, I found that this browsing by page-up key doesn't work on one ubuntu machine, so I want to add this capability to the system for convenience.

I did a little search, and found that ading these two lines to my .bashrc file will fix the problem:

bindkey -k up history-search-backward
bindkey -k down history-search-forward

but it didn't work, and in fact, it says

bindkey: command not found
bindkey: command not found

Any idea how to solve this issue on ubuntu?

share|improve this question

migrated from stackoverflow.com May 27 '13 at 13:50

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

up vote 1 down vote accepted

Since you are using bash and not zsh try putting the following in your ~/.inputrc

"\e[5~": history-search-backward
"\e[6~": history-search-forward
share|improve this answer
    
This file doesn't exist, so I created one! But still it doesn't work! – Vahid Mir May 30 '13 at 23:46
    
Ah, looks like I gave you the keys for up/down arrows. Edited to be page up/down. – demure May 30 '13 at 23:58

You must log in to answer this question.

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