How to check for spyware on Mac- Steps to follow.

I have come across a software that is spyware. I have a Mac. I want to know how to check for spyware on Mac?

I have come across a software that is spyware. I have a Mac. I want to know how to check for spyware on Mac?
Spyware is a type of software. It allows advertising and changing the configuration of our device. It help us in collecting personal information. Spyware can slow down the network or machine.
Step 1: Select Applications and then Utilities and then click on Terminal app.
Step 2: Press Return after typing sudo lsof -i | grep LISTEN.
Step 3: Press Return after entering password.
Step 4: Type “lsof | grep cwd” after finding the processes and again hit Return.
Step 5: Select Return after selecting Enter “sudo rm -rf [path to file]”.