牛客220118974号
牛客220118974号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客220118974号的博客
全部文章
(共18篇)
题解 | netstat练习2-查看和3306端口建立的连接
#!/bin/bash cat nowcoder.txt | grep tcp | tr -s ' ' | cut -d ' ' -f 5 | grep 3306 | cut -d ':' -f 1 | sort | uniq -c | tr -s ' ' | sed 's/^ //' | sor...
2025-11-02
0
21
题解 | netstat练习1-查看各个状态的连接数
#!/bin/bash a=$(cat nowcoder.txt | grep tcp | tr -s ' ' | cut -d ' ' -f 6 | sort | uniq -c | tr -s ' ' | sed 's/^ //' | sort -rn -t ' ' -k 1) l=$(ech...
2025-11-02
0
19
题解 | Nginx日志分析6-统计每分钟的请求数
#!/bin/bash cat nowcoder.txt | cut -d ':' -f 2,3 | sort | uniq -c | tr -s ' ' | sed 's/^ //' | sort -r
2025-11-02
0
17
题解 | nginx日志分析5-统计爬虫抓取404的次数
#!/bin/bash cat nowcoder.txt | grep 'www\.baidu\.com' | cut -d ' ' -f 9 | grep 404 | wc -l
2025-11-02
0
19
题解 | Nginx日志分析4-查询某个IP的详细访问情况
#!/bin/bash cat nowcoder.txt | grep '192\.168\.1\.22' | cut -d ' ' -f 7 | sort | uniq -c | tr -s ' ' | sed 's/^ //' | sort -r
2025-11-02
0
18
题解 | nginx日志分析3-统计访问3次以上的IP
#!/bin/bash a=$(cat nowcoder.txt | cut -d ' ' -f 1 | sort | uniq -c | tr -s ' ' | sed 's/ //' | sort -r) l=$(echo "$a" | wc -l) for (( i=1;...
2025-11-02
0
20
题解 | Nginx日志分析2-统计某个时间段的IP访问量
#!/bin/bash cat nowcoder.txt | grep "23/Apr/2020:2[0-3]" | cut -d ' ' -f 1 | sort | uniq | wc -l
2025-11-02
0
22
题解 | Nginx日志分析1-IP访问次数统计
#!/bin/bash cat nowcoder.txt | grep '23/Apr/202' | cut -d ' ' -f 1 | sort | uniq -c | tr -s ' ' | sed 's/^ //' | sort -r
2025-11-02
0
18
题解 | 处理文本
#!/bin/bash emu=$(cat nowcoder.txt | cut -d ':' -f 1 | sort | uniq) for i in $emu;do echo "[$i]" while read line;do col1=$(...
2025-11-02
0
24
题解 | 格式化输出
#!/bin/bash while read line;do l=$(($(echo $line | wc -c) - 1)) for (( i=1;i<$l;i=i+1 ));do if [ $(($i%3)) -eq 0 ];then ...
2025-11-02
0
21
首页
上一页
1
2
下一页
末页