Last active
August 29, 2015 14:23
-
-
Save ryannealmes/4f6b5da6e327de2184bc to your computer and use it in GitHub Desktop.
grep large files
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
B = before | |
A = after | |
grep -B [number of lines] -A [number of lines] [search string] [file] | |
If you want the same number of lines before and after you can use -C num. | |
grep -C [number of lines] [search string] [file] | |
Credit: http://stackoverflow.com/questions/9081/grep-a-file-but-show-several-surrounding-lines |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment