3 ms·rg -B2 -A2 foo can be written as rg -C2 foo although this does not underline your point as much.by sshine 3y agorg -B2 -A2 foo can be written as rg -C2 foo although this does not underline your point as much.mkl 3y agoYep, edited that in as you were commenting.nerdponx 3y agoPerhaps for further emphasis: grep -R -C2 foo .