Skip to content

Instantly share code, notes, and snippets.

@jsteenkamp

jsteenkamp/osx-dsclean

Last active Aug 29, 2015
Embed
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 ]
then
echo "Delete __MACOSX folder from $1"
zip -d "$1" __MACOSX*
echo "Delete all .DS_Store folders from $1"
zip -d "$1" \*.DS_Store
fi
}
-----
$ nano ~/.bash_profile
if [ -f ~/.bash_rc ]
then . ~/.bash_rc
fi
alias dsclean='dsclean';
@jsteenkamp

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 files.zip

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