Why does terminal auto complete sometimes not suggest anything for the `services` command?
Solution 1:
The degree to which auto-completion works is a function of how well the shell scripts in the bash-completion
package work.
In Ubuntu 14.04, the script that handles completions for service
is in /usr/share/bash-completion/bash_completion
. It looks for service names as files in /etc/rc.d/init.d
and /etc/init.d
, and in the output of systemctl list-units --full --all
.
But installing the vsftpd
package doesn't put any files in /etc/init.d
, because it has been systemd
-ified; it puts a config file in /etc/systemd/system/vsftpd.service
. systemctl list-units
would find that file if not for the fact that Ubuntu, at the present time, doesn't include a systemctl
command.
So, at the moment, you won't get auto-completions for service vsftpd
, but you will for most other services, since their config files are in /etc/init.d
.
Solution 2:
When there are multiple possible suggestions, tab will not produce any suggestion. Using tab tab (double tab) will produce a list of all possible suggestions.
Solution 3:
vsftpd has probably more than 1 option. tab twice to view the possibilities.
Example: li
with tabtab shows:
libnetcfg line lintian-info lispmtopgm
libreoffice linguist linux32 listres
lightdm link linux64
lightdm-session lintian linux-boot-prober