In bash, suppose I have these commands:
$ pyt[TAB][TAB]
pytest
python
python-config
python-dbg
99% of the time, I'd go for python
. It's so annoying that pytest
pops up and prevents me from typing only pyt[TAB][RETURN]
to invoke python
. Can I hide pytest
from bash completion?
My limitations:
I know that I can remove the
pytest
binary at/usr/bin/pytest
to prevent that suggestion within bash. But what if I have no root access? What ifpytest
is an important script that must exist in order to let other scripts work properly?Even though I can remove the
pytest
binary (and I've done it before), some time when I upgrade my software, this script comes back again.I know that I can use an
alias
to save keystrokes for my favorite applications (maybe justp
forpython
). But I don't like these non-standard abbreviations. It kind of makes me confused when I remote to other machines.
So, is there any way to hide some commands from bash completion? Answers in other shells (zsh, fish, etc) are welcome since bash doesn't speed up my workflow lately.