Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

4 Answers

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

share|improve this answer
add comment

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

share|improve this answer
add comment

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
add comment

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

share|improve this answer
add comment

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

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

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.