James's Ramblings

grep

Created: May 02, 2019 (Updated: September 05, 2020)
Description Command
Case insensitive. -i
Include INT lines after matched strings. -A INT
Include INT lines before matched strings. -B INT
The same number of lines before and after. -C INT
Return files with no match. -L
Invert match. -v

Find non-ASCII characters

grep -R --color='auto' -P -n "[\x80-\xFF]" DIRECTORY

Find non-Unicode characters

grep -axvR '.*' DIRECTORY