How to remove Trovi malware from Safari?
Before killing false culprits at random with a great chance to damage your working environment, I suggest you to first attack your original problem.

Download a correct malware hunter:
Malwarebytes.

Disclaimer: I don't work for them, they have a free version.

I tested it on many versions of OSX (Mavericks, Yosemite...) and found and fixed some well hidden crapwares left undetected by leader commercial anti-virus.

Warning: There are a lot of bad and good methods to get rid of Trovi found on the web. Avoid to download from unchecked sources, as you wouldn't drink from any found bottle.

I didn't test the following, but trust its author since many years.
I advise you to apply the receipe from Linc Davis:

How to remove Trovi from Safari