On Fri 16 May 2025 at 14:57:15 (-0400), Greg Wooledge wrote:
> On Fri, May 16, 2025 at 16:39:15 +0100, Chris Green wrote:
> > fxkl4...@protonmail.com wrote:
> > > when i type ssh and two tabs i get a list of host
> > > numeric and names
> > > where do they come from
> > 
> > Assuming you are using bash (or another shell that does TAB
> > completion) I think it's probably just a list of file and directory
> > names in the current directory. 
> > 
> > Try doing the same in a different directory.
> 
> No, it's almost certainly programmable completion from the bash-completion
> package.

Yes, it is bash-completion. It's a minor inconvenience when you have
a very large number of hosts defined:

  $ ssh 
  Display all 13590 possibilities? (y or n)

and use ssh or scp for file transfer on the LAN.

> It's installed and used by default in Debian.

It may be installed, but I've always had to use:

  [ -f /etc/bash_completion ] && . /etc/bash_completion # Use bash-completion 
if available

in order for it to work:

  $ grep -A8 'bash completion' /etc/bash.bashrc 
  # enable bash completion in interactive shells
  #if ! shopt -oq posix; then
  #  if [ -f /usr/share/bash-completion/bash_completion ]; then
  #    . /usr/share/bash-completion/bash_completion
  #  elif [ -f /etc/bash_completion ]; then
  #    . /etc/bash_completion
  #  fi
  #fi

  $ 

Cheers,
David.

Reply via email to