Reset Safari in MacOs Big Sur

My Safari browser freezes immediately upon launch, so I want to completely reset all settings.

(the problem is I accidentally bookmarked a Jupyter server in Favorites, and this freezes the client completely upon startup, because the server address does not exist anymore)

I tried deleting my bookmarks:

rm -Rf ~/Library/Safari/Bookmarks.plist

and other Safari plist files I could find:

rm -Rf ~/Library/Preferences/com.apple.Safari.plist

But that does not completely remove the Favorites, it still visible after launch: frozen Safari

How do I remove the Favorites? In what file are they stored?

I cannot do anything in the browser because it shows a spinning wheel, so I need to delete all settings from outside Safari.

update: Not sure what did it, but after a reboot and opening Safari while holding shift+option+command the favorites were reset, so now it works again.


Solution 1:

Here is the way to reset all Safari settings from terminal :

First you quit Safari then :

rm ~/Library/Preferences/com.apple.Safari*

rm -r ~/Library/Containers/com.apple.Safari

rm -r ~/Library/Caches/com.apple.Safari

I think it's enough.

Edit.

You can try a boot in Safe Mode to clear the system caches. Then you reboot in normal mode.