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 was wondering, if I have a folder structure like this:


how can I run zip command, zip everything except file ending with _fpartNumber. I only know this command,

zip -r .
share|improve this question

migrated from Mar 28 '13 at 20:15

This question came from our site for professional and enthusiast programmers.

Surely you must be aware of the commands zip --help and man zip too – Crisp Mar 28 '13 at 19:21
You might try posting this at instead of here. – EmmyS Mar 28 '13 at 19:29
@Harts I've updated my answer to show a wildcard for the number. – AbsoluteƵERØ Mar 29 '13 at 21:01
zip -r foo foo -x \*.o 

which will include the contents of foo in while excluding all the files that end in .o.

share|improve this answer
x command option is for excluding. – a3.14_Infinity Mar 28 '13 at 19:26

Try this:

find . -name "*_fpart*" -print | zip -@
share|improve this answer

You must log in to answer this question.