
Note that you don’t provide a file name on the command line, you must provide a path. To search through nested directories and subdirectories, use the -r (recursive) option. We can check the return code using the $? special parameters: grep -q average geek-1.log echo $? grep -q howtogeek geek-1.log echo $? A result of zero means the string was found, and a result of one means it was not found. The result is passed to the shell as a return value from grep. We can cause grep to be completely silent.
