Skip to main content
1 of 3
Archemar
  • 32.3k
  • 18
  • 75
  • 107

grep solution

grep '^=.*rst' *.adoc 

where

  • ^ begin of line
  • = equal
  • .* anything any number of time
  • rst string rst (you were looking for fifth ? )

this will list files and found line

first.adoc:= The title of the first file 

to only files use -l ( or --file-with-matches)

grep -l '^=.*rst' *.adoc 

to only list lines and not the filename use -h (or --no-filename)

see man grep

Archemar
  • 32.3k
  • 18
  • 75
  • 107