Question

I recently moved from tcsh to bash, and have been adjusting to the different tab completions.

I use shopt -s autocd so I don't need to explicitly type cd in front of things, which is where the problem lies.

The only problem I have is that in my PATH is /usr/local/bin/, and inside that folder is an executable called This.Is.A.Really.Long.File.To.Execute.

Unfortunately, the git structure I use has the paths ~/git/company/This.Is/This.Is.A.Really.Long/This.Is.A.Really.Long.File/file.txt

So if I am in ~/git/company/This.Is and type This.I<TAB> it immediately completes to This.Is.A.Really.Long.File.To.Execute, which is the executable in my PATH.

I can't change the folder structure or move the executable because other processes/scripts use it. Is there a way to keep autocd and specifically ignore anything in /usr/local/bin/ from tab-completing?

Was it helpful?

Solution

To force Bash to only look in the current directory, you could always type:

./This.I<TAB>

Then again it's probably easier to just type cd.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top