Tuesday, June 18, 2019

mac - Trying to grep the output of fs_usage with poor results

I'm trying to figure out what process is periodically and silently erasing the contents of the /etc/hosts file on a Mac. I tried using:


sudo fs_usage | grep hosts

but it only generates a few seconds of output and then returns me to the command prompt, after which trying to restart fs_usage tells me:


ktrace_start: Resource busy

Once that happens, the only way I know how to re-enable fs_usage is to restart the computer, as I can't find either fs_usage or the ktrace process. Piping the output of grep to a text file generated nothing and behaved the same way.



  1. Why is grep ceasing all output after a few seconds?

  2. How can I make fs_usage available again without restarting?

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...