Match string and print a line number only using Linux shell - LinuxConfig.org

Here is a simple example on how to search a file and instead of printing a matching string to STOUT we only print a line number for a matching string. For an example consider a following file:
This is a companion discussion topic for the original entry at https://linuxconfig.org/match-string-and-print-a-line-number-only-using-linux-shell