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

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?

share|improve this question
up vote 5 down vote accepted

Try doing this :

exec bash

this will do the trick...

share|improve this answer
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

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)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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