I organize all my text notes in AsciiDoc files. AsciiDoc is a file format similar to Markdown but instead of # I use = to denote a first level-heading, like so:
first-file.adoc
= How To Install MySQL 8.0 on Fedora second-file.adoc
= Summaries and Notes From Books I've Read Knowing that each file include one and "only one" first-level heading = This is a First-Level Heading and it is always on line number 1, my goal is to search through all files using grep and only look in those first-level headings.
This grep command matches the second file:
grep -in '^= .*ooks' *.adoc It makes sense and it is what I need. However my terminal highlight with red everything up until the word "Books" and leaves the rest "I've Read" with white. Is that normal?
= Summaries and Notes From Books I've Read
.* rstwould matchfi rstbut neverfirstgrep '^= ' *.adoc | grep -in 'rst'it seems to work.