Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I'm currently trying to switch from OpenSUSE to Ubuntu as my main OS. While most of opensuse features is there in ubuntu, there is one feature that doesn't. In Opensuse, I can always use Ctrl+Up to autocomplete the command line using previously typed command. That feature is very useful for me as it allows me to work faster without having to retype long command.

Can anyone provide a way to enable this on Ubuntu?

Thank you

share|improve this question

You can autocomplete a partially typed terminal command using Page Up, which does a reverse search of previously typed commands. But this functionality needs to be enabled.

For example typing:

ge Page Up in the terminal autocompletes to

gedit the_doc_i_open_previously.txt

To enable this terminal functionality. Edit the following file.

gksudo gedit /etc/inputrc

find the lines:

# alternate mappings for "page up" and "page down" to search the history
# "\e[5~": history-search-backward
# "\e[6~": history-search-forward

remove the # to uncomment the two lines:

"\e[5~": history-search-backward
"\e[6~": history-search-forward

and save the file. You now have reverse history search. I think this is what you were looking for.

share|improve this answer
might have to restart the terminal too for the functionality to take place – dodohjk Jul 5 '14 at 14:19

You can use the key to scroll through your history. Using Ctrl+R you can search through the history.

share|improve this answer

Just press up: . This shows you the last commands you run.

share|improve this answer

Get rid of "Control"! JUst Up key :)

share|improve this answer

protected by Bruno Pereira Jun 1 '12 at 9:56

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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