xiaocaijiyizhibale
xiaocaijiyizhibale
全部文章
分类
归档
标签
去牛客网
登录
/
注册
xiaocaijiyizhibale的博客
全部文章
(共9篇)
题解 | #nginx日志分析6-统计每分钟的请求数#
#!/bin/bash awk '{arr[substr($4,14,5)]++}END{for(i in arr) print arr[i]" "i}' nowcoder.txt |sort -k 1 -r
2023-04-14
0
203
题解 | #nginx日志分析2-统计某个时间段的IP#
#!/bin/bash cat nowcoder.txt |awk '($4~/23\/Apr\/2020:2[0-3]/){print $1}'|sort -u|wc -l
2023-04-13
0
168
题解 | #打印只有一个数字的行#
#!/bin/bash cat nowcoder.txt |grep '[0-9]\{1\}'| grep -v '[0-9]\{2\}'
2023-04-11
2
225
题解 | #转置文件的内容#
#/bin/bash awk '{print $1}' nowcoder.txt |xargs echo && awk '{print $2}' nowcoder.txt |xargs echo
2023-03-31
0
174
题解 | #去掉不需要的单词#
#!/bin/bash grep -iv "b" nowcoder.txt
2023-03-01
1
249
题解 | #去掉所有包含this的句子#
#!/bin/bash grep -v 'this' nowcoder.txt
2023-02-28
0
264
题解 | #转置文件的内容#
#!/bin/bash awk '{for(i=0;++i<=NF;)a[i]=a[i]?a[i] FS $i:$i}END{for(i=0;i++<NF;)print a[i]}' nowcoder.txt
2023-02-28
1
205
题解 | #第二列是否有重复#
#!/bin/bash #!/bin/bash awk '{a[$2]++}END{for(i in a) print a[i],i}' nowcoder.txt | awk '($1>1){print $1,$2}' |sort -n
2023-02-28
0
236
题解 | #去掉空行#
#!/bin/bash cat nowcoder.txt | tr -s "\n"
2023-02-27
0
262