Unofficial archive. This is a read-only, community-run archive of the Apple Support Community. It is not affiliated with or endorsed by Apple Inc.

Compression tool is accidentally copying unwanted files and folders into the zip file.

I have a folder which is approximately 39mb and I tried to compress it. Bizarrely, the zip file that is created is 35mb and when I opened it, it had gathered up other files and folders from my desktop. I have tried to create a new folder and drag all the desired files across, but still get the same result. I also did Force / Quit on Finder and went back in to select the folder via Finder but same result again.


I use an iMac M1 and the OS is Sequoia 15.7.2. I would be most grateful if anyone can advise me on how to get out of this situation - thanks.


Justin

7 replies

I tried to sort this out on the Terminal as you advised, but keep getting the same message about 'no action necessary' - so I may have to give this one up.


Would it be better to download Keka, or is that just going to gather up unwanted files as well?

The Finder's secondary menu Compress will include any selected files in that zip file. If the folder and any other Desktop item (including a Stack) are selected, then in they go. If you selected only a folder to compress, then only that folder and its contents would be in that foldername.zip container.


If you are doing this from the Terminal, then you would issue the appropriate command as illustrated in:


https://developermemos.com/posts/compress-folder-zip-macos-terminal/


The Finder's secondary menu Compress will include .DS_Store and __MACOSX files into your folder zip. The latter is associated with any file that has Finder extended attributes set on it. To avoid this clutter, you will need the Terminal:


If the folder (e.g. PDF) to zip is on your Desktop, do the following to explicitly exclude specific files:

cd ~/Desktop
zip -r PDF.zip PDF -x '**/.DS_Store' '**/__MACOSX'
zipinfo PDF.zip




I have tested this on macOS 27.0.1 and it works as expected. Just the remaining files in the folder go into the archive and nothing else. Under no circumstances, when I select a folder without any other selections, does the Finder Compress pull in files from outside of that designated folder.

personally I just use the app called double commander, mark the files I wish to compress and click on the

menu

files->pack files

give a zip name and


bob's your uncle..

swinging gus gorilla wrote:
why does it pick up unwanted files when I use right-click / Compress?

Maybe you should post a screenshot from just before you choose Compress. No one has ever heard of anything like what you describe.

Hi VikingOSX


Thanks for your reply.


I'm still puzzled as the folder contains only the files I want to compress - why does it pick up unwanted files when I use right-click / Compress? I tried using the Terminal as you suggested, but it's not picking up the desired folder.

Thanks, I'll look into that.