日志分析命令总结

读取

tail

cat

tac

筛选

grep

处理

awk

sed

统计

uniq

排序

sort

案例

统计 nginx 访问 IP,倒序排列

1
grep "16/Feb/2022:03"  nginx.access.log | awk '{print $1}' | sort | uniq -c | sort -n -r
Author: suce
Link: https://haoubox.cn/2022/02/25/日志分析命令总结/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.