Advanced

How to enable command autocomplete by searching history in Linux

Posted by axel on · 1 comment
www.my-guides.net; By axel
Mail this story
Print this story

Being a Linux user for many users I am using command line a lot. A very useful functionality of Linux command line is autocompleting commands by reverse searching history. What I mean by that? Let's say that while I am typing some commands I want to reuse a cat command I had typed 10 commands ago. Instead of pressing the up arrow 10 times to find this comand I will just type cat and pressing up arrow will bring back only those commands I have already typed starting with cat. Here's how to enable it.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Linux

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (1)

I find articles like this one to be rather disappointing.

This was basically little more than a brief "cut and paste this utterly mysterious bit of code into that particular file", Not even a hint of how or why it works, aside from the name of file (".inputrc") where you paste the code received from on high.

- - - - - - - - +

Apparently this is related to "readline" -- I'm guessing this is basically adding some emacs-mode commands to the readline defaults. After some digging, it looks to me like the answers are to be found in an info file called "rluserman" (I assume that's short for "readline user manual").

A comment to that effect would have saved me a great deal of time (and then I'd have had some time to actually look a little closer at that rluserman info file)

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post