Coggle requires JavaScript to display documents.
正则表达式
grep "^root\>" /etc/passwd
echo "sshd Port&&pid: $(sudo netstat -apn | grep chrome | sed -nr '/:::/s/.*:::([0-9]+).*\ ([0-9]+)\/chrome/\1 \2/p')"
[^ ] # 除了括号以内的字符都匹配 [ - ] # 字符范围 ? * + # 数量限定词 \< # 匹配单词的开头 \> # 匹配单词的结尾 \b # 匹配单词的开头和结尾 \B # 匹配非单词的开头和结尾 | # 逻辑或,最好放在()内
grep -E '\bmi' b.txt grep -E 'ni\b' b.txt grep -E 'ab\B' b.txt grep -E '(\bab|ab\b)' b.txt
grep -E '([0-9]{1,3}\.){3}[0-9]{1}' b.txt egrep '([0-9]{1,3}\.){3}[0-9]{1}' b.txt
192.168.1.1 1234.234.04.5678 123.4234.045.678 abcde
grep '\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1\}' b.txt