Skip to content

Instantly share code, notes, and snippets.

@kassi
Created August 1, 2012 08:18
Show Gist options
  • Save kassi/3224919 to your computer and use it in GitHub Desktop.
Save kassi/3224919 to your computer and use it in GitHub Desktop.
Update URLs in Safari Bookmarks & History
# close Safari!
cd ~/Library/Safari
cp Bookmarks.plist History.plist ~ # make a backup!!
# convert to readable
plutil -convert xml1 Bookmarks.plist
plutil -convert xml1 History.plist
# change with regex
sed -e 's/our\.old\.url/my\.new\.url/' -i.orig Bookmarks.plist
sed -e 's/our\.old\.url/my\.new\.url/' -i.orig History.plist
# check
diff Bookmarks.plist.orig Bookmarks.plist
diff History.plist.orig History.plist
# if ok, convert back
plutil -convert binary1 Bookmarks.plist
plutil -convert binary1 History.plist
@NicolasDaigneault
Copy link

Thanks it work!

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