grep 如何解决匹配前后的字符
grep 如何解决匹配前后的字符
echo "45645645645aaa45645646" | grep -o -P '.{0,3}aaa.{0,4}'
645aaa4564
前 3 个字符,后 4 个字符
哪些目录安装了anaconda3
locate anaconda3 | grep -o -P '.{0,100}anaconda3.{0,1}' | sort | uniq
REF
https://www.jb51.cc/faq/2946726.html