Created
November 18, 2015 08:36
-
-
Save tikolakin/3218a43d8c2092e0f86c to your computer and use it in GitHub Desktop.
How to find patterns across multiple lines using grep?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#If you are willing to use contexts, this could be achieved by typing | |
grep -A 500 abc test.txt | grep -B 500 efg | |
#This will display everything between "abc" and "efg", as long as they are within 500 lines of each other. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment