Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I want to make tab completion to complete on specific programs in path although there maybe other possible completion in path.

For example, if I type mpl and tab, it should complete to mplayer though there might be other programs in the path starting with mpl. I know of bash alias builtin for ~/.bashrc but thats not what I'm looking for.

share|improve this question

marked as duplicate by slm, jasonwryan, Evan Teitelman, Anthon, rahmu Jul 21 '13 at 12:08

This question was marked as an exact duplicate of an existing question.

If you've installed the bash-completion package it includes everything you need in the way of examples. I'd look through any of the included files as examples. The ntpdate one is pretty basic.

$ less /etc/bash_completion.d/ntpdate
$ less /usr/share/bash-completion/ntpdate
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.