I have two machines, laptop and server. Both of them source /etc/bash_completion in .bashrc.

What works:

server$ scp file laptop:~/stage/[tab][tab]
server$ scp laptop:~/stage/[tab][tab] .
server$ rsync -r folder laptop:~/stage/[tab][tab]

What doesn't work

laptop$ scp file server:/data/[tab][tab]
laptop$ scp server:/data/[tab][tab] .
laptop$ rsync -r folder server:/data/[tab][tab]

The laptop is running ubuntu 16.04 and the server is running 18.04.


rsync version 3.1.2

scp/ssh don't take --version


rsync version 3.1.1

scp/ssh don't take --version

Both machines have the other's public key, and ssh (as well as actual rsync/scp transfers) work without password. Clearly everything is set up as it works one way, but I can't figure out what would be causing it to fail in the other direction?

  • I can reproduce this on Debian. Looking at the /usr/share/doc/bash-completion/changelog.Debian.gz file, I have 1:2.1-4.3 for the one that completes but only 1:2.0-1 for the one that doesn't. If you get a similar difference it may simply be that the newer version completes more accurately.
    – roaima
    Nov 2 '18 at 23:23
  • That directory doesn't exist on laptop - which prompted me to check, /etc/bash_completion doesn't exist either - I'm missing a package. What do I have to install on the laptop? Nov 8 '18 at 17:07

I've found the solution - bash-completion package was never installed on the laptop.

It's a misleading issue, because in .bashrc the source of the file is correct, and it doesn't throw an error. However the file never existed.

The bashrc does check, however for /usr/share/bash-completion/bash_completion which does exist. Why it doesn't work, I don't know.

sudo apt install bash-completion fixes the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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