Grep command is killed

command linekernel

I am running grep -o $string ~/giant_file
where

string="foo
bar
baz"

This process keeps being killed after running for awhile and generating results, and I don't understand why. When it is killed, the following is output to the console:

[1] 69923 killed grep --color=auto --exclude-dir={.bzr,.cvs,.git,.hg,.svn} $string *

Is there a way to check the kernel logs to see why this is? In linux I would got to /var/log/kern.log to see if it is an OOM issue but I am not sure what to do on osx. If it isn't an oom issue, I am not sure what could be causing this, so other hypotheses are welcome.

Best Answer

  • Logs are in /var/log/System.log, you can also access them by running Console.app
  • Memory consumption of a process can be checked in Activity Monitory.app, at least as long as the process is running