Server Fault is a question and answer site for system and network administrators. 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 am distributing packaged files in ZIP format. I use the following to create:

zip -r files/

When expanded on other UNIX system files preserve their permissions as they were when I packed them. I am willing to avoid storing permission information.

My question is: Is it possible to do so? I'm using info-zip 3.0

The problem is that on my system i use umask 0002 and files are writable for groups. However when expanded on other systems, groups write permission is not desired. I could remove group write permissions, but then it wouldn't work on my system.

share|improve this question
up vote 0 down vote accepted

I can't spot a suitable option to control permissions when unzipping

Using tar however, there's the option --no-same-permissions which may help, the manual page says:

       apply the user's umask when extracting permissions from the archive

Does that do the trick for you?

Alternately, if you want to use a zip file, you might want to try creating it with a different program. For example, Apache Ant gives you full control over the permissions of files and directories it zips up - has details. For example, you could do something like:

<zip destfile="">
   <zipfileset dir="dist" filemode="664" dirmode="755" />
share|improve this answer
Actually, tar handles it properly in either case. but the ZIP is still a problem. – romaninsh May 27 '11 at 12:25
Try creating the zip with something like Ant then? See updated answer for details – Gagravarr May 27 '11 at 12:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.