Use the -s flag for suppressing error messages about unreadable file or files that don’t exist.
Consider a test.txt file with the following content:
sad
happy
awake
coffee
work
schoolSearching for “happy” with the -s flag doesn’t really do anything special since test.txt does in fact exist.
$ grep -s "happy" test.txt
happySuppose there was a typo and we typed best.txt instead, we would see an error:
$ grep "happy" best.txt
grep: best.txt: No such file or directoryThe -s flag will suppress that error:
$ grep -s "happy" best.txt