MacOS – How to hide favourites bar in mac os using bash script

bashmacmacos

I'm trying to disable and enable the favourite bar in mac os "Yosemite" using bash script, I used the following command in terminal but it didn't work even after I restarted Safari, so am I doing something wrong?

defaults write com.apple.Safari ShowFavoritesBar -bool false

Best Answer

You need to add a -v2 for Yosemite. See below:

defaults write com.apple.Safari ShowFavoritesBar-v2 -bool false

Restart Safari.