Reset Safari from Terminal

I have got Bing redirect, the situation is fairly similar to the one laid down here Bing redirect Mac virus removal from Safari, Firefox, Chrome - MacSecurity. I wonder if I remove Safari with Terminal the issue is gone. Or maybe there is a command that restores Safari search and home-page settings to default. To give you a clue Sean's Help Desk (formerly Computer User Support): Completely reset Safari to fix problems, there is a bunch of commands that allegedly change Safari settings, but I do not know which of these, if any, can change home-page and search preferences:
mv ~/Library/Safari ~/Desktop/Safari-date +%Y%m%d%H%M%S;
rm -Rf ~/Library/Caches/Apple\ -\ Safari\ -\ Safari\ Extensions\ Gallery;
rm -Rf ~/Library/Caches/Metadata/Safari;
rm -Rf ~/Library/Caches/com.apple.Safari;
rm -Rf ~/Library/Caches/com.apple.WebKit.PluginProcess;
rm -Rf ~/Library/Cookies/Cookies.binarycookies;
rm -Rf ~/Library/Preferences/Apple\ -\ Safari\ -\ Safari\ Extensions\ Gallery;
rm -Rf ~/Library/Preferences/com.apple.Safari.LSSharedFileList.plist;
rm -Rf ~/Library/Preferences/com.apple.Safari.RSS.plist;
rm -Rf ~/Library/Preferences/com.apple.Safari.plist;
rm -Rf ~/Library/Preferences/com.apple.WebFoundation.plist;
rm -Rf ~/Library/Preferences/com.apple.WebKit.PluginHost.plist;
rm -Rf ~/Library/Preferences/com.apple.WebKit.PluginProcess.plist;
rm -Rf ~/Library/PubSub/Database;
rm -Rf ~/Library/Saved\ Application\ State/com.apple.Safari.savedState

This topic was automatically closed after 166 days. New replies are no longer allowed.