sed、awk、grep 等常用命令

sed常用來替換修改文本內容,比如:永久關閉selinux

setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

截取日誌:訪問我們網站最多的TOP 20 的IP

awk '{print $1}' 2018-05-10_app\(1\).log | sort -n |uniq -c | sort -rn | head - 20

查看cpu核數

cat /proc/cpuinfo |grep "cores"|uniq
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章