What is the point of “grep -q”

The exit status of grep doesn’t necessarily indicate an error ; it indicates success or failure. grep defines success as matching 1 or more lines. Failure includes matching zero lines, or some other error that prevented matching from taking place in the first place. -q is used when you don’t care about which lines matched, only … Read more

grep a large list against a large file

Try grep -f the_ids.txt huge.csv Additionally, since your patterns seem to be fixed strings, supplying the -F option might speed up grep. -F, –fixed-strings Interpret PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched. (-F is specified by POSIX.)