Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
OSX bash function and alias to remove hidden directories from zip files
$ nano ~/.bash_rc
function dsclean() {
if [ -f $1 ]
echo "Delete __MACOSX folder from $1"
zip -d "$1" __MACOSX*
echo "Delete all .DS_Store folders from $1"
zip -d "$1" \*.DS_Store
$ nano ~/.bash_profile
if [ -f ~/.bash_rc ]
then . ~/.bash_rc
alias dsclean='dsclean';

This comment has been minimized.

Copy link
Owner Author

@jsteenkamp jsteenkamp commented May 10, 2015

Run from terminal and specify the zip file to process:

$ dsclean

You can also use OSX apps like Keka and YemuZip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment