xixixao
xixixao

Reputation: 563

Bash cd command autocompletion for custom alias

Let's say I have a simple function serving as an alias to cd.

c(){ cd "$@"; }

How can I get the original autocompletion of cd work for my new function? Note that cd only autocompletes directory names, not simple file names.

I know about the complete command, but where exactly is the autocompletion function used by cd located?

Thanks for help!

Upvotes: 3

Views: 656

Answers (1)

msw
msw

Reputation: 43527

Look for /etc/bash_completion or /etc/bash_completion.d for the system-wide defaults.

Upvotes: 1

Related Questions