Auto complete for often used command line commands?

If the commands are often used, they are recorded in the command history bash tracks in .bash_history.

Now the trick: You can reverse search this history to re-execute commands by pressing CTRL-r.

In inverse history search mode, bash shows, live, as you type, the most recent command in the history that start with your given input. Then press enter to accept and execute the proposed command. Keep pressing CTRL-R to cycle to older commands with the same prefix.

This is builtin in bash, no need for customizing scripts or install software :) It is one of the most useful features of bash, imho.


Final Term

There is this very promising Terminal App Called Final Term. Among its many features, it also has a history of remebering commands, so that you can then select it. Here are some more features:

Final Term

You can read more about it in this article.

Here is the the website from the creators. http://finalterm.org/

To Install it

sudo add-apt-repository ppa:versable/finalterm-daily
sudo apt-get update
sudo apt-get install finalterm

Warning

I have said that it is promising. The only issue is that it is at version 0.1. So some things like vim and nano don't work well yet. I have also noticed that it does not yet support Drag-and-Drop, and copy and paste. But it does have the feature you request. As the software matures, it will become one of the best terminals for the desktop.

Screenshot

Here is the function in action:

 function in action

Hope this helps.

*I am on Saucy, so that is why I have a Salamander background :)


Paste (Ctrl-Shift-V) the following into a terminal screen:

echo '"\e[A": history-search-backward' > ~/.inputrc
echo '"\e[B": history-search-forward' >> ~/.inputrc
echo 'set show-all-if-ambiguous on' >> ~/.inputrc
echo 'set completion-ignore-case on' >> ~/.inputrc

Exit (Ctrl-D) the terminal screen, then open Terminal again.

Now you can just type the first couple of characters, then press Up or Down to scroll through the filtered list