IT lexicon › Programming › grep

grep

Programming På svenska → Updated: 2026-05-26

Unix tool for regex-based searching in text. Ken Thompson, 1973. Name from the ed command g/re/p = "Globally find Regular Expression and Print". Central to Unix workflow.

Classic syntax: grep 'pattern' file.txt or via pipe: cat file | grep pattern. -i case-insensitive, -r recursive, -v invert match, -l list filenames only, -n show line numbers. Variants: egrep (extended regex, default in many modern greps), fgrep (fixed string, faster). Modern alternatives: ripgrep (rg, Rust, fastest), ag (the silver searcher), ack (Perl). VS Code + Cursor use ripgrep under the hood for search.

← Back to the lexicon