linux grep 显示前后几行

grep -C 5 foo file 前后
grep -B 5 foo file before
grep -A 5 foo file after

你可能感兴趣的:(linux grep 显示前后几行)