When a review starts with matching lines, the file names can be the part that matters most. Use grep -l when the handoff needs the files that contain a pattern, not every line that matched inside those files.
The -l option prints each matching file once and stops reading that file after the first match. Combine it with -R when the search should walk below one or more directories.
The sample below uses three small files across separate directories: two mention /login and one does not. The expected proof is that grep -R -l /login app docs tmp lists only the two matching files, while grep -R -L /login app docs tmp lists the file that contains no match.
$ mkdir -p app docs tmp $ cat > app/routes.conf <<'EOF' GET /health status=ok POST /login status=requires_auth EOF $ cat > docs/runbook.md <<'EOF' Check /health before rotating workers. Run /login tests after deploying auth changes. EOF $ cat > tmp/cache.txt <<'EOF' temporary cache entry EOF
$ grep -R -l /login app docs tmp app/routes.conf docs/runbook.md
grep -l prints file names, not matching lines. Each matching file appears once even if the pattern appears more than once inside it.
$ grep -R -L /login app docs tmp tmp/cache.txt
grep -L is the file-level inverse of -l. It is useful before adding a missing setting or finding files that skipped a required token.
$ grep -R -l /health app docs tmp app/routes.conf docs/runbook.md
$ rm -r app docs tmp