Skip to content

Instantly share code, notes, and snippets.

@jasperf
Last active March 18, 2026 06:33
Show Gist options
  • Select an option

  • Save jasperf/2965b4c54bdf4868b2c49db9b15fe2ad to your computer and use it in GitHub Desktop.

Select an option

Save jasperf/2965b4c54bdf4868b2c49db9b15fe2ad to your computer and use it in GitHub Desktop.
grep -A5 | head -30 - Show 5 lines after each match of the pattern & Displays only the first 30 lines of the output.
# It searches the file plumbing.json for the string "secondary" (including the quotes).
# For each match, it prints the matching line and the next 5 lines.
# It then limits the total output to the first 30 lines.
grep -A5 '"secondary"' ~/code/imagewize.com/demo/web/app/themes/elayne/styles/plumbing.json | head -30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment