Super User is a question and answer site for computer enthusiasts and power users. 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

I'm on my $HOME directory, there is a file. I want to extract it into $HOME/work directory, which exists

I type unzip foo it expands the filename, I enter but it doesn't expand the "w" to the "work" directory

How make this work ? In Bash this works out of the box.

share|improve this question
What exactly did you type? My version of unzip expects the second argument to be the name of a file inside the archive, and that's what zsh completes. To extract to a different directory, I type unzip -d w, and zsh does complete w into work. – Gilles Jan 2 '11 at 15:50
@Gilles: Your comment should be an answer. The difference is that the Bash completion function for unzip is simple-minded and doesn't look at the contents of the archive or whether -d is present. The zsh completion for unzip is much more sophisticated. – Dennis Williamson Jan 2 '11 at 16:54

You need to preceed the exdir (the directory to expand into) with the '-d' switch.

share|improve this answer
And I need to go through and add some functionality to my Easy Extract function in bash. – Rob Apr 6 '12 at 19:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .