Skip to content

Instantly share code, notes, and snippets.

@kobanyan
Last active January 21, 2017 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kobanyan/ab01d9145b1aff10f4f84949ad9d8438 to your computer and use it in GitHub Desktop.
Save kobanyan/ab01d9145b1aff10f4f84949ad9d8438 to your computer and use it in GitHub Desktop.
Export all plist as xml
#!/bin/bash
dest="${1:-"$HOME/plist-xmls"}/`date "+%Y%m%d%H%M%S"`"
if [ -e "$dest" ]; then
echo "$dest exists already."
exit 1
fi
mkdir -p "$dest"
for file in `find "$HOME/Library/Preferences/" -type f -name *.plist -depth 1`; do
filename=${file##*/}
domain=${filename%.*}
defaults export "$domain" - > "$dest/${filename}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment