Skip to content

Instantly share code, notes, and snippets.

@greyltc
Last active March 8, 2019 08:40
Show Gist options
  • Save greyltc/9d859ccade09322a77deaf1d80c2b427 to your computer and use it in GitHub Desktop.
Save greyltc/9d859ccade09322a77deaf1d80c2b427 to your computer and use it in GitHub Desktop.
grepper
# this will search every file recursively for the follwing strings: "0.0055" "0.0060" "0.0065" "0.0069" "0.0072"
grep -r -A4 0.0055 . | grep -B1 -A3 0.0060 | grep -B2 -A2 0.0065 | grep -B3 -A1 0.0069 | grep -B4 0.0072
# it will return 4 line matches where the strings are on different consecutive lines and appear in that order
grep -r -A2 0.8521 . | grep -B1 -A1 0.8217 | grep -B2 0.791
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment