OpenWindows Advanced User's Guide

4.1.3 Searching for Lines without a Certain String

To search for all the lines of a file that don't contain a certain string, use the -voption to grep. The following example shows how to find all of the lines in the user medici's home directory files that don't contain the letter e:

$ ls
actors    alaska    hinterland    tutors    wilde
$ grep -v e *
actors:Mon Mar 14 10:00 PST 1936
wilde:That is all.