Skip to main content
deleted 13 characters in body
Source Link
Archemar
  • 32.3k
  • 18
  • 75
  • 107

grep solution

search

grep '^=.*rst.*$' *.adoc 

where

  • ^ begin of line
  • = equal
  • .* anything any number of time
  • rst string rst
  • .* anything any number of time
  • $ end of line

this will list files and found line

first.adoc:= The title of the first file 

print result

grep will highlight what part of line triggered the match, so

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

will highlight

first.adoc:= The title of the first file

because search to end-of-line wasn't requested.

grep grep '^=.*rst.*$' *.adoc 

will highlight

first.adoc:= The title of the first file

because search to end-of-line was requested.


 

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

grep solution

search

grep '^=.*rst.*$' *.adoc 

where

  • ^ begin of line
  • = equal
  • .* anything any number of time
  • rst string rst
  • .* anything any number of time
  • $ end of line

this will list files and found line

first.adoc:= The title of the first file 

print result

grep will highlight what part of line triggered the match, so

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

will highlight

first.adoc:= The title of the first file

because search to end-of-line wasn't requested.

grep grep '^=.*rst.*$' *.adoc 

will highlight

first.adoc:= The title of the first file

because search to end-of-line was requested.


 

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

grep solution

search

grep '^=.*rst.*$' *.adoc 

where

  • ^ begin of line
  • = equal
  • .* anything any number of time
  • rst string rst
  • .* anything any number of time
  • $ end of line

this will list files and found line

first.adoc:= The title of the first file 

print result

grep will highlight what part of line triggered the match, so

grep '^=.*rst' *.adoc 

will highlight

first.adoc:= The title of the first file

because search to end-of-line wasn't requested.

grep '^=.*rst.*$' *.adoc 

will highlight

first.adoc:= The title of the first file

because search to end-of-line was requested.

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

added 426 characters in body
Source Link
Archemar
  • 32.3k
  • 18
  • 75
  • 107

grep solution

search

grep '^=.*rst'*rst.*$' *.adoc 

where

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

this will list files and found line

first.adoc:= The title of the first file 

print result

grep will highlight what part of line triggered the match, so

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

will highlight

first.adoc:= The title of the first file

because search to end-of-line wasn't requested.

grep grep '^=.*rst.*$' *.adoc 

will highlight

first.adoc:= The title of the first file

because search to end-of-line was requested.


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

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

grep solution

search

grep '^=.*rst.*$' *.adoc 

where

  • ^ begin of line
  • = equal
  • .* anything any number of time
  • rst string rst
  • .* anything any number of time
  • $ end of line

this will list files and found line

first.adoc:= The title of the first file 

print result

grep will highlight what part of line triggered the match, so

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

will highlight

first.adoc:= The title of the first file

because search to end-of-line wasn't requested.

grep grep '^=.*rst.*$' *.adoc 

will highlight

first.adoc:= The title of the first file

because search to end-of-line was requested.


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

Source Link
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