thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Systems & Data Center · Foundational

grep

A Linux command that searches text for lines matching a pattern or regular expression.

Definition

Useful options include -i (ignore case), -v (invert), -r (recursive), -n (line numbers), -c (count), -E (extended regex) and -l (filenames only).

Example

grep -rn 'Listen' /etc/httpd/conf/ finds Listen directives with line numbers.

Exam tip

grep -v '^#' filters out commented lines from a config file.

Related terms