[Bash-completion-devel] ~/.bash_history completion

Ville Skyttä ville.skytta at iki.fi
Sat Dec 10 09:11:13 UTC 2011


On 12/07/2011 10:14 PM, Maciej Ciemborowicz wrote:

> Is there a known way of completing commands from ~/.bash_history? 

Not that I know of, but I believe it would be fairly easy to write such
a completion function.  My first thought is that it's probably not
something we want to do in bash-completion though.

> Sometimes I use gcc with some sophisticated options. I also use ssh with 
> long logins and URLs. And I have to press up arrow multiple times.

For ssh you can define Host aliases in configs, those are offered as
completions.  And for generic cases there's Ctrl-R for searching through
the history which reduces the number of needed up arrow presses.



More information about the Bash-completion-devel mailing list