Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Using the git status command, I had:

modified:   conf/test.conf

Is it possible to configure bash in that way so when I type git diff *test.conf and press TAB for auto-complete, it would expand it to full path. i.e: conf/test.conf?

share|improve this question

I'm not a nor a expert, but this works for me:

git diff *$(file="$(git status -s)"; echo ${file:2})

I haven't tested yet with multiple pending files or multiple directories, but you can change and use these to work mostly like a shortcut to your file/directory.

For using the TAB key in the terminal, I don't think there's an easy way to change the terminal keys behavior based on the running command (Someone correct me if I'm wrong).

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.