I have set up aliases for apt-get update
, apt-get install
, and so on.
Thats quite convenient. But what I really would like to have is something like this:
type agi
TAB
vi
and have it automatically list all packages starting with vi, as it would happen when issuing apt-get install
TAB
vi
.
Would something like this be achievable somehow, maybe by writing a little script?
Best Answer
Bash programmable completion is something I haven't bothered much with myself, but I believe this will do what you want (NB assumes bash version 4.0 or newer. If you run Ubuntu 10.04 or newer, you're good.):
Programmable Completion in bash's manual explains how it works, though it's quite complex.