{"slug": "grep", "name": "grep", "category": "terminal", "category_name": "Terminal and shell", "description": "Classic Unix command-line utility for searching text with regular expressions.", "recommenders": 5, "commenters": 7, "warners": 0, "score": 5.031, "rising": -0.31, "first": "2026-01-15", "latest": "2026-10-12", "why": "HN commenters value grep for being fast and flexible with no indexing step, and for coming preinstalled, so it is there on any server they log into.", "why_is_quote": false, "has_verdict": true, "sentiment": {"recommend": 5, "neutral": 2, "compare": 0, "warn": 0}, "spark": [0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1], "listed": true, "loved": ["Simple and sufficient", "Speed"], "caveat": "Slow recursive scans", "short_quote": "In general, in my experience, grep is better than almost anything else you can use.", "icon": true, "domain": null, "github_repo": null, "official_url": "https://www.gnu.org/software/grep/", "pricing": "open source", "aliases": ["grep"], "verdict": [{"text": "HN commenters value grep for being fast and flexible with no indexing step", "cites": [{"id": 800913777, "item_id": 50057111, "url": "https://news.ycombinator.com/item?id=50057111", "by": "ltbarcly3", "date": "2026-10-12", "stance": "recommend", "quote": "In general, in my experience, grep is better than almost anything else you can use.", "excerpt": "In general, in my experience, grep is better than almost anything else you can use. It's very very fast and efficient, very flexible, and does not require any indexing pass, is never out of date, and doesn't require you to guess ahead of time what files you might want to search or how to process search tokens. \"Search your files, repos and agent sessions, locally, and give your agents the best context for the job. On", "context": "", "use_case": "searching code", "switched_from": "", "story": "Local Indexing to reduce tool calling and token usage"}, {"id": 784888864, "item_id": 49055554, "url": "https://news.ycombinator.com/item?id=49055554", "by": "m-manu", "date": "2026-07-26", "stance": "recommend", "quote": "grep is great. It comes pre-installed on your OS.", "excerpt": "grep is great. It comes pre-installed on your OS. In fact, a search using grep is faster than the search on your IDE when there is no code index! But, one key pain when using grep for searching in your source code or configuration files? A `grep -r` command scans all files (including binary files ) and not just source code files, making it slow. Sometimes, terribly slow. Yes, I'm aware of source-code-aware search too", "context": "", "use_case": "searching source code", "switched_from": "", "story": "Source Code Grep: Use your own grep, but make it source code aware"}]}, {"text": ", and for coming preinstalled, so it is there on any server they log into.", "cites": [{"id": 784888864, "item_id": 49055554, "url": "https://news.ycombinator.com/item?id=49055554", "by": "m-manu", "date": "2026-07-26", "stance": "recommend", "quote": "grep is great. It comes pre-installed on your OS.", "excerpt": "grep is great. It comes pre-installed on your OS. In fact, a search using grep is faster than the search on your IDE when there is no code index! But, one key pain when using grep for searching in your source code or configuration files? A `grep -r` command scans all files (including binary files ) and not just source code files, making it slow. Sometimes, terribly slow. Yes, I'm aware of source-code-aware search too", "context": "", "use_case": "searching source code", "switched_from": "", "story": "Source Code Grep: Use your own grep, but make it source code aware"}, {"id": 760078003, "item_id": 47504875, "url": "https://news.ycombinator.com/item?id=47504875", "by": "ventana", "date": "2026-03-24", "stance": "recommend", "quote": "the closer my setup is to the default one, the better", "excerpt": "One thing I learned over the years is that the closer my setup is to the default one, the better. I tried switching to the latest and greatest replacements, such as ack or ripgrep for grep, or httpie for curl, just to always return to the default options. Often, the return was caused by a frustration of not having the new tools installed on the random server I sshed to. It's probably just me being unable to persevere", "context": "", "use_case": "text search", "switched_from": "ripgrep", "story": "Ripgrep is faster than {grep, ag, Git grep, ucg, pt, sift}"}]}, {"text": " The main caveat is that a recursive grep also scans binary files and can be slow", "cites": [{"id": 784888864, "item_id": 49055554, "url": "https://news.ycombinator.com/item?id=49055554", "by": "m-manu", "date": "2026-07-26", "stance": "recommend", "quote": "grep is great. It comes pre-installed on your OS.", "excerpt": "grep is great. It comes pre-installed on your OS. In fact, a search using grep is faster than the search on your IDE when there is no code index! But, one key pain when using grep for searching in your source code or configuration files? A `grep -r` command scans all files (including binary files ) and not just source code files, making it slow. Sometimes, terribly slow. Yes, I'm aware of source-code-aware search too", "context": "", "use_case": "searching source code", "switched_from": "", "story": "Source Code Grep: Use your own grep, but make it source code aware"}]}, {"text": ", and some commenters switch to ripgrep for very large files.", "cites": [{"id": 760648513, "item_id": 47540532, "url": "https://news.ycombinator.com/item?id=47540532", "by": "1a527dd5", "date": "2026-03-27", "stance": "neutral", "quote": "I use grep a lot in an ad hoc manner on really large files I switch to rg.", "excerpt": "I appreciate performance as much as the next person; but I see this endless battle to measure things in ns/us/ms as performative. Sure there are 0.000001% edge cases where that MIGHT be the next big bottleneck. I see the same thing repeated in various front end tooling too. They all claim to be _much_ faster than their counterpart. 9/10 whatever tooling you are using now will be perfectly fine. Example; I use grep a ", "context": "", "use_case": "ad hoc searching", "switched_from": "", "story": "A Faster Alternative to Jq"}]}], "praise": [{"label": "Simple and sufficient", "summary": "Commenters call it a simple tool that is good enough for everyday searching.", "quotes": [{"id": 754622832, "item_id": 47163927, "url": "https://news.ycombinator.com/item?id=47163927", "by": "thesuperbigfrog", "date": "2026-02-26", "stance": "recommend", "quote": "It is good to know grep, sed, and awk", "excerpt": "grep, sed, and awk are nice simple tools but were followed by perl which is a more comprehensive tool and a complete programming language. perl advanced the state of the art for regular expressions such that most regular expression implementations are \"perl compatible\". From HN user unpythonic: \"When perl came out we were living in horrific times. You had the choice of either Bourne, C or Korn shell. Automation was g", "context": "", "use_case": "text processing", "switched_from": "", "story": "Grep, Sed, Awk \u2013 The Unix Text Processing Trinity"}, {"id": 785983617, "item_id": 49123976, "url": "https://news.ycombinator.com/item?id=49123976", "by": "stevekemp", "date": "2026-07-31", "stance": "neutral", "quote": "I use grep, emacs, and I don't feel like I have anything that needs mitigation.", "excerpt": "LSP services make it trivial to jump to definitions, as well as local cross-references and filesystem views it's just not something that's a concern. Could I scroll around 5ms faster with a different UI? Probably, but it wouldn't change my habits. I use grep, emacs, and I don't feel like I have anything that needs mitigation.", "context": "", "use_case": "searching source code", "switched_from": "", "story": "Ask HN: Navigating Source Code (especially on large projects)"}, {"id": 760648513, "item_id": 47540532, "url": "https://news.ycombinator.com/item?id=47540532", "by": "1a527dd5", "date": "2026-03-27", "stance": "neutral", "quote": "I use grep a lot in an ad hoc manner on really large files I switch to rg.", "excerpt": "I appreciate performance as much as the next person; but I see this endless battle to measure things in ns/us/ms as performative. Sure there are 0.000001% edge cases where that MIGHT be the next big bottleneck. I see the same thing repeated in various front end tooling too. They all claim to be _much_ faster than their counterpart. 9/10 whatever tooling you are using now will be perfectly fine. Example; I use grep a ", "context": "", "use_case": "ad hoc searching", "switched_from": "", "story": "A Faster Alternative to Jq"}]}, {"label": "Speed", "summary": "Described as very fast, even faster than IDE search when there is no code index.", "quotes": [{"id": 800913777, "item_id": 50057111, "url": "https://news.ycombinator.com/item?id=50057111", "by": "ltbarcly3", "date": "2026-10-12", "stance": "recommend", "quote": "In general, in my experience, grep is better than almost anything else you can use.", "excerpt": "In general, in my experience, grep is better than almost anything else you can use. It's very very fast and efficient, very flexible, and does not require any indexing pass, is never out of date, and doesn't require you to guess ahead of time what files you might want to search or how to process search tokens. \"Search your files, repos and agent sessions, locally, and give your agents the best context for the job. On", "context": "", "use_case": "searching code", "switched_from": "", "story": "Local Indexing to reduce tool calling and token usage"}, {"id": 784888864, "item_id": 49055554, "url": "https://news.ycombinator.com/item?id=49055554", "by": "m-manu", "date": "2026-07-26", "stance": "recommend", "quote": "grep is great. It comes pre-installed on your OS.", "excerpt": "grep is great. It comes pre-installed on your OS. In fact, a search using grep is faster than the search on your IDE when there is no code index! But, one key pain when using grep for searching in your source code or configuration files? A `grep -r` command scans all files (including binary files ) and not just source code files, making it slow. Sometimes, terribly slow. Yes, I'm aware of source-code-aware search too", "context": "", "use_case": "searching source code", "switched_from": "", "story": "Source Code Grep: Use your own grep, but make it source code aware"}]}, {"label": "Preinstalled everywhere", "summary": "It ships with the OS, so it is available on random servers where replacements are missing.", "quotes": [{"id": 784888864, "item_id": 49055554, "url": "https://news.ycombinator.com/item?id=49055554", "by": "m-manu", "date": "2026-07-26", "stance": "recommend", "quote": "grep is great. It comes pre-installed on your OS.", "excerpt": "grep is great. It comes pre-installed on your OS. In fact, a search using grep is faster than the search on your IDE when there is no code index! But, one key pain when using grep for searching in your source code or configuration files? A `grep -r` command scans all files (including binary files ) and not just source code files, making it slow. Sometimes, terribly slow. Yes, I'm aware of source-code-aware search too", "context": "", "use_case": "searching source code", "switched_from": "", "story": "Source Code Grep: Use your own grep, but make it source code aware"}, {"id": 760078003, "item_id": 47504875, "url": "https://news.ycombinator.com/item?id=47504875", "by": "ventana", "date": "2026-03-24", "stance": "recommend", "quote": "the closer my setup is to the default one, the better", "excerpt": "One thing I learned over the years is that the closer my setup is to the default one, the better. I tried switching to the latest and greatest replacements, such as ack or ripgrep for grep, or httpie for curl, just to always return to the default options. Often, the return was caused by a frustration of not having the new tools installed on the random server I sshed to. It's probably just me being unable to persevere", "context": "", "use_case": "text search", "switched_from": "ripgrep", "story": "Ripgrep is faster than {grep, ag, Git grep, ucg, pt, sift}"}]}, {"label": "No indexing", "summary": "It needs no indexing pass and is never out of date.", "quotes": [{"id": 800913777, "item_id": 50057111, "url": "https://news.ycombinator.com/item?id=50057111", "by": "ltbarcly3", "date": "2026-10-12", "stance": "recommend", "quote": "In general, in my experience, grep is better than almost anything else you can use.", "excerpt": "In general, in my experience, grep is better than almost anything else you can use. It's very very fast and efficient, very flexible, and does not require any indexing pass, is never out of date, and doesn't require you to guess ahead of time what files you might want to search or how to process search tokens. \"Search your files, repos and agent sessions, locally, and give your agents the best context for the job. On", "context": "", "use_case": "searching code", "switched_from": "", "story": "Local Indexing to reduce tool calling and token usage"}]}], "caveats": [{"label": "Slow recursive scans", "summary": "`grep -r` also scans binary files rather than just source files, which can make it very slow.", "quotes": [{"id": 784888864, "item_id": 49055554, "url": "https://news.ycombinator.com/item?id=49055554", "by": "m-manu", "date": "2026-07-26", "stance": "recommend", "quote": "grep is great. It comes pre-installed on your OS.", "excerpt": "grep is great. It comes pre-installed on your OS. In fact, a search using grep is faster than the search on your IDE when there is no code index! But, one key pain when using grep for searching in your source code or configuration files? A `grep -r` command scans all files (including binary files ) and not just source code files, making it slow. Sometimes, terribly slow. Yes, I'm aware of source-code-aware search too", "context": "", "use_case": "searching source code", "switched_from": "", "story": "Source Code Grep: Use your own grep, but make it source code aware"}]}, {"label": "Very large files", "summary": "One commenter switches to ripgrep for really large files.", "quotes": [{"id": 760648513, "item_id": 47540532, "url": "https://news.ycombinator.com/item?id=47540532", "by": "1a527dd5", "date": "2026-03-27", "stance": "neutral", "quote": "I use grep a lot in an ad hoc manner on really large files I switch to rg.", "excerpt": "I appreciate performance as much as the next person; but I see this endless battle to measure things in ns/us/ms as performative. Sure there are 0.000001% edge cases where that MIGHT be the next big bottleneck. I see the same thing repeated in various front end tooling too. They all claim to be _much_ faster than their counterpart. 9/10 whatever tooling you are using now will be perfectly fine. Example; I use grep a ", "context": "", "use_case": "ad hoc searching", "switched_from": "", "story": "A Faster Alternative to Jq"}]}], "who": [], "tags": ["for code search", "for remote servers", "for AI agent context"], "use_cases": ["searching code", "searching source code", "ad hoc searching", "text search", "text processing"], "compared": [{"slug": "ripgrep", "name": "ripgrep", "co": 7, "switched_from": 1, "switched_to": 1}, {"slug": "ack", "name": "ack", "co": 4, "switched_from": 0, "switched_to": 0}, {"slug": "fff", "name": "fff", "co": 1, "switched_from": 0, "switched_to": 1}, {"slug": "sqlite", "name": "SQLite", "co": 2, "switched_from": 0, "switched_to": 0}, {"slug": "ag", "name": "ag", "co": 2, "switched_from": 0, "switched_to": 0}, {"slug": "claude-code", "name": "Claude Code", "co": 2, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=50049508", "title": "Local Indexing to reduce tool calling and token usage", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49109652", "title": "Ask HN: Navigating Source Code (especially on large projects)", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49055553", "title": "Source Code Grep: Use your own grep, but make it source code aware", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47539825", "title": "A Faster Alternative to Jq", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47499245", "title": "Ripgrep is faster than {grep, ag, Git grep, ucg, pt, sift}", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47163198", "title": "Grep, Sed, Awk \u2013 The Unix Text Processing Trinity", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {}, "2026-01": {"recommend": 1}, "2026-02": {"recommend": 1}, "2026-03": {"recommend": 1, "neutral": 1}, "2026-04": {}, "2026-05": {}, "2026-06": {}, "2026-07": {"recommend": 1, "neutral": 1}, "2026-08": {}, "2026-09": {}, "2026-10": {"recommend": 1}}, "quotes": [{"id": 800913777, "item_id": 50057111, "url": "https://news.ycombinator.com/item?id=50057111", "by": "ltbarcly3", "date": "2026-10-12", "stance": "recommend", "quote": "In general, in my experience, grep is better than almost anything else you can use.", "excerpt": "In general, in my experience, grep is better than almost anything else you can use. It's very very fast and efficient, very flexible, and does not require any indexing pass, is never out of date, and doesn't require you to guess ahead of time what files you might want to search or how to process search tokens. \"Search your files, repos and agent sessions, locally, and give your agents the best context for the job. On", "context": "", "use_case": "searching code", "switched_from": "", "story": "Local Indexing to reduce tool calling and token usage"}, {"id": 785983617, "item_id": 49123976, "url": "https://news.ycombinator.com/item?id=49123976", "by": "stevekemp", "date": "2026-07-31", "stance": "neutral", "quote": "I use grep, emacs, and I don't feel like I have anything that needs mitigation.", "excerpt": "LSP services make it trivial to jump to definitions, as well as local cross-references and filesystem views it's just not something that's a concern. Could I scroll around 5ms faster with a different UI? Probably, but it wouldn't change my habits. I use grep, emacs, and I don't feel like I have anything that needs mitigation.", "context": "", "use_case": "searching source code", "switched_from": "", "story": "Ask HN: Navigating Source Code (especially on large projects)"}, {"id": 784888864, "item_id": 49055554, "url": "https://news.ycombinator.com/item?id=49055554", "by": "m-manu", "date": "2026-07-26", "stance": "recommend", "quote": "grep is great. It comes pre-installed on your OS.", "excerpt": "grep is great. It comes pre-installed on your OS. In fact, a search using grep is faster than the search on your IDE when there is no code index! But, one key pain when using grep for searching in your source code or configuration files? A `grep -r` command scans all files (including binary files ) and not just source code files, making it slow. Sometimes, terribly slow. Yes, I'm aware of source-code-aware search too", "context": "", "use_case": "searching source code", "switched_from": "", "story": "Source Code Grep: Use your own grep, but make it source code aware"}, {"id": 760648513, "item_id": 47540532, "url": "https://news.ycombinator.com/item?id=47540532", "by": "1a527dd5", "date": "2026-03-27", "stance": "neutral", "quote": "I use grep a lot in an ad hoc manner on really large files I switch to rg.", "excerpt": "I appreciate performance as much as the next person; but I see this endless battle to measure things in ns/us/ms as performative. Sure there are 0.000001% edge cases where that MIGHT be the next big bottleneck. I see the same thing repeated in various front end tooling too. They all claim to be _much_ faster than their counterpart. 9/10 whatever tooling you are using now will be perfectly fine. Example; I use grep a ", "context": "", "use_case": "ad hoc searching", "switched_from": "", "story": "A Faster Alternative to Jq"}, {"id": 760078003, "item_id": 47504875, "url": "https://news.ycombinator.com/item?id=47504875", "by": "ventana", "date": "2026-03-24", "stance": "recommend", "quote": "the closer my setup is to the default one, the better", "excerpt": "One thing I learned over the years is that the closer my setup is to the default one, the better. I tried switching to the latest and greatest replacements, such as ack or ripgrep for grep, or httpie for curl, just to always return to the default options. Often, the return was caused by a frustration of not having the new tools installed on the random server I sshed to. It's probably just me being unable to persevere", "context": "", "use_case": "text search", "switched_from": "ripgrep", "story": "Ripgrep is faster than {grep, ag, Git grep, ucg, pt, sift}"}, {"id": 754622832, "item_id": 47163927, "url": "https://news.ycombinator.com/item?id=47163927", "by": "thesuperbigfrog", "date": "2026-02-26", "stance": "recommend", "quote": "It is good to know grep, sed, and awk", "excerpt": "grep, sed, and awk are nice simple tools but were followed by perl which is a more comprehensive tool and a complete programming language. perl advanced the state of the art for regular expressions such that most regular expression implementations are \"perl compatible\". From HN user unpythonic: \"When perl came out we were living in horrific times. You had the choice of either Bourne, C or Korn shell. Automation was g", "context": "", "use_case": "text processing", "switched_from": "", "story": "Grep, Sed, Awk \u2013 The Unix Text Processing Trinity"}, {"id": 746098048, "item_id": 46631128, "url": "https://news.ycombinator.com/item?id=46631128", "by": "reify", "date": "2026-01-15", "stance": "recommend", "quote": "I love grep", "excerpt": "I would have to get an external 2TB expansion drive to store all the extra lines of code it created. It wouldnt remember though. Its a computer thingy. It would just grep the new lines of code that are stored on my new external drive I love grep sorted!", "context": "", "use_case": "searching code", "switched_from": "", "story": "What If Your AI Never Forgot? The Claude 4 Memory Experiment"}]}