Skip to content

Comment on Grep flags – the good stuff

Comments

Honorable mention for `-q`, which is useful in shell scripts when you don't want the output, just the result code.

I am a big fan of the `if [!] grep -q ...` pattern. I'd probably rank -q near the top of the list for shell scripts.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.