Text Processing1 / 18
Up next

grep basics

#!/usr/bin/env bash

# feed sample lines into grep without a real file
printf '%s\n' apple banana cherry apricot |
  # print only the lines that contain "ap"
  grep 'ap' 
What you're solving

match lines containing a pattern