Skip to main content
to grep

to grep

1 9.1
To look through files to find lines with specific text
  • verb
  • /ɡrɛp/
  • Specialized
: grep
  • To find all instances of 'error' in the log file, you can grep that term using the command line.

Nowadays, if you just dare one use the verb grep for it.

Examples

  • Whenever we sensed a problem ("Is one of the Solr indexes getting slow?") we would liberally apply ssh, tail -f, and grep to try to see what was going on.

    Blog text (8)
  • What I want this script to do is to write all the nmap output to one file (which it is doing), and then grep that output and write only the IP addresses to a separate file (it will write only one IP address before I get the "The process cannot access the file because it is being used by another process." error message.)

    Blog text (11)
  • If I need to narrow down the output, I grep something like httpd or whatever processes I am looking into.

    Blog text (27)
  • So I can grep them once running Eudora no longer becomes an option, or possibly even write my own customized search engine.

    Blog text (14)
  • I want to run an nmap script against my targets, grep the output, and save the results to a txt document.

    Blog text (11)
  • Another search would be -- grep "base64decode" *.php, which will pull any files with encode 64?s in them. wp-app.php should be the only one pulled, and it has two instances.

    Blog text (27)
  • If both of those fail, I would strace the client (using -ff -o /tmp/strace.out or so) and grep for one of the filesystems it's not picking up, and see what errors it's getting, or if it's even trying.

    Blog text (22)
  • If you're building an error log, the two most important things you need are exact timestamps (to correlate the log entry with an action or bug report) and the ability to grep, sort, count, and do other basic things.

    Blog text (16)
  • If you want to search for specific code snippets, you should grep through all the files in the project directory.

  • I need to grep the output from the data analysis to find any occurrences of 'success'.

Synonyms

to look for
vsto grep
∞ 1.0

To try to find something or someone

is more technical used for pattern searches in files on computers
to search
vsto grep
∞ 1.0

To try to find something or someone by looking carefully

focuses on finding specific text patterns inside files using a command line tool
to regex
vsto grep
  • Specialized
7.2

To search and change text using a pattern

applies that method specifically to files using a command line tool

Surface Forms

grep infinitive
grepped past
grepped past participle
grepping present participle
greps third person singular

Etymology

Grep comes from the old editor command g/re/p, which literally told the program to do a 'global' 'search for a pattern' and 'print' the results. So to grep is to search through files for specific text and show the matching lines.