Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • It seems with this suggestion I will find .udp files, but only if no .zip files are present. If a test.zip and test.udp file is present in the current directory, unzip <tab> only lists the .zip file. I would expect to see both files (i.e. the bash completion would give test.). Commented Jan 8, 2014 at 16:36
  • Are you sure? I checked on my bash and I seem to find both udp and zip files. Did you source .bashrc after adding the line? Commented Jan 8, 2014 at 16:43
  • I repeated in a new terminal, and now unzip <tab> list all files, even ones ending in a different phrase. Now quite what I need. Commented Jan 8, 2014 at 16:51
  • Strange.. I am running GNU bash version 4.2.25 and works as expected. Which version of bash are you on? Commented Jan 8, 2014 at 17:02
  • Could you try adding two separate lines: complete -f -o default -X '!*.zip' unzip and complete -f -o default -X '!*.udp' unzip Commented Jan 8, 2014 at 17:06