To list every occurrence of the term “warn” on a separate line, run grep -o warn . Adding the r flag to the command makes recursive search for every file under the given path, and the I flag ensures that matches in binary files are ignored. In addition, the w flag can be included to match the exact term only, and ignore superstrings such as “warnings”, and to make the search case-insensitive, the i flag can be added. % grep -iworI warn | wc -l
12