Taco Steemers

A personal blog.

Articles tagged with grep

Notes on grep

Table of contents:

Basics

A basic search:

grep "search pattern" filename_path

A case-insensitive search:

grep -i "search pattern" filename_path

Text has to be at the start of the line:

grep "^text" filename_path

Printing the line number in the output:

grep -n "search pattern" filename_path

Printing 3 lines …