Created
April 27, 2016 16:27
-
-
Save trigfa/3bece15821bf7f008e78f9eac062e229 to your computer and use it in GitHub Desktop.
Searching for text in a file with context (2 lines before and after) and piping output to a file
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
grep -A 2 --after-context=2 --before-context=2 "Text we're searching for" input_file.txt >> output_file.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment