grep is a Linux utility commonly used for searching file contents, or any input passed to it. When searching through multiple files, it’s useful to display the filename and line numbers, especially when using it to automate in shells scripts.
How to Use grep to Display Filenames & Line Numbers Before Matching Lines