Zip Files on Mac Without Invisible Files

Mac makes zipping files easy, But properly zipping files without invisible files takes a little know-how.

When moving files across platforms, cleanliness is key. The invisible files that Mac creates to handle basic functions (like Finder) make your daily usage easier, but like anything good - There's a catch. The largest issue is the tiny little files that Mac includes. I ran into a case where I needed to create a perfectly clean folder zip file to sell online and it took a little work, but I found the perfect approach.

How To Zip Files From Command Line...

Open your Terminal application (don't worry - I promise this is an easy one). Place the file that you need to zip into an easy to reach location. In this example, the folder I want to zip is directly under my Mac username (So... Harddrive > Users > Myusername > Folder I want to Zip). Then simply enter the code below and all you need to adjust is YOURFILENAME and YOURZIPNAME for whatever your desired input and output will be.

zip -r YOURFILENAME -x "*.DS_Store"

Ok, No Invisible Files... But why?

Most people view Terminal... or anything prompt based as an odd kind of magic, but it doesn't have to be... Step by step, this is what's happening. You're telling Terminal that you want to make a Zip. Then you're stating that it's recursive - Meaning you want everything in that folder to be included. You're giving the name that you want the resulted file to have, followed immediately by the filename that you currently have (if it was in a lower location, you'd simply backslash your way to the folder... if it were on your desktop you'd use Desktop/YOURFILENAME). The "-x" says, we want to remove a few things before you initiate the Zip. Then finally you state what you want to get rid of - the ".DS_Store" files in this case.

Files Zipped!! Not too tough, right?

Terminal can be intimidating - It certainly was (and in some respects still is) to me. Hopefully this can get you off to a running start on using Mac's core functions and a bare minimum - You should have that invisible files problem solved! If you have a better method or another comment, please feel free to leave it below. As always - if you find this post at all helpful, please share it!

  • Published:
  • Author:
  • Category: tutorial
  • Share:
  • Title: Zip Files on Mac Without Invisible Files
  • Summary: Zipping files is easy, but if you need to properly zip files on Mac without invisible files appearing - that takes a little more know-how.
Signup for Linode & Get $100 Credit Donate A Coffee