I have a directory containing a disk image, let's call it "image.dd". In reality it is a much longer name, thus the desire to table complete the name by typing the first character and hitting tab to get the rest. There are only a few files in the directory, each starting with a unique letter.
If I type
ls i<TAB> the command completes properly to
But if I type
fdisk -l i<TAB> nothing happens. This is really annoying. I get the impression that tab completion is snooping on my command and seeing the "fdisk" part and saying, "Oh, you can't fdisk a regular file, so I'm going to ignore your request to autocomplete the file, even though it is actually there."
Of course when I manually type in the name it works, I can fdisk a file when it's a disk image, so how can I get tab completion to just work?
Using Ubuntu 16.04, bash version is 4.3.42.