After renaming a file to a similar name, I noticed TAB was still completing the old filename (if it matched the letters so far) and not showing the new one. No matter how many letters I typed, it refused to complete the new name.

I fixed it simply by starting a new shell. All good, but I'm still curious about what happened.

I assume Bash is caching the file strings somewhere and the cache had failed to refresh/clear itself when the file had been renamed. Is my assumption correct, and if so, how could the cache be auto-refreshed?

  • Bash doesn't cache filenames internally, unless you have some funky bash completion from somewhere else that's doing it. Were you just doing x/y/z, or some_command x/y/z? I think it's much more likely that it could be a third party bash completion doing it judging by the description.
    – Chris Down
    Commented Oct 15, 2015 at 14:57
  • Ah yes, I had recently installed github.com/git/git/blob/master/contrib/completion/…. Must be it.
    – mahemoff
    Commented Oct 15, 2015 at 23:43

1 Answer 1


I had recently installed git completion which does some caching. I'll need to look in more detail but anyway, it does cache, so that's the cause here.

  • Did you ever resolve how to clear the cache?
    – Novice C
    Commented Sep 15, 2017 at 21:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .