This may have been asked before but I couldn't find it. I am grepping a lot of data files for "NaN" to search for errors; the problem is that if "NaN" appears once in a file, in all likelihood it will appear thousands of times and hence the output will be unmanageable. Specifically, the command
grep "NaN" *
yields about a gigabyte of output, virtually all of which is redundant. How do I suppress all the specific lines where "NaN" appears and instead print only the name of the file?