Skip Navigation or Skip to Content

Mac zip cleaner

Mac OS does not suppress system files when zipping folders.

This little helper script and instructions were put together by a student (James R. C.) and are being used with permission.

Download cleanzip.sh and save locally

Instructions

Launch your Mac Finder Window and navigate to your directory that contains the folder you want to zip. In this example the zip target is "Assignment04".

Hold down Control key and mouse click your folder and select the option to compress it. This will create a zip folder version of the folder.

Copy the file ‘cleanzip.sh’ to the same directory as your zip file.

The next steps take place in the Terminal. Open your Mac Terminal and navigate to the folder containing the zipped folder and the zip file using the ‘cd’ commands.

Next type command: ls
This will display files in the folder you navigated to as shown here:

Once you verify you can see your zip file file and ‘clean.sh’ script as shown above, type the following command to execute your bash script:
bash cleanzip.sh
You should see the script execute in real time and outputting what is being cleaned up.

Note: You can open ‘clean.sh’ with most text editors and should be able to see the manual commands that this script contains.