Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Now available on Stack Overflow for Teams! AI features where you work: search, IDE, and chat.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How can I zip a directory like -foo? $ zip "-foo" "-foo" shows only help page.
-foo
$ zip "-foo" "-foo"
I think -foo is recognized as a options, but I don't know how to solve it.
The general way for doing things like this is to prefix the file name with ./.
./
zip foo.zip ./-foo
This technique works most other utilities which accept a file name as an argument.
Try:
zip foo.zip -- -foo
Simply put -- before the filename(s).
--
Try using --
For example:
zip foo.zip -- -folder