8

I have a script for auto-completing my ssh-hosts. If I change my ~/.ssh/config the auto-completion is not updated automatically, though. This does not surprise me. In a new shell, the new entry is picked up and usable, of course.

How do I manually trigger a refresh of the completion in bash?

11

Try doing this :

exec bash

this will do the trick...

  • 2
    neat, that replaces the current shell... In a way, that like opening a new shell, but still nice. – kronn Oct 19 '12 at 17:36
8

See reload bash completion functions file

. /etc/bash_completion.d/filename

(adapt /etc depending on where your bash_completion scripts are deployed, replace filename by the appropriate script)

  • 1
    Usually . /etc/bash_completion is my solution. – Duncan Jones Mar 2 '18 at 11:03

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.