代码片段(3)[全屏查看所有代码]
1. [代码][Shell/批处理]代码
01 |
awk '{print
$1}' access.log
| sort | uniq -c
| sort -nr
| head -n
10 |
02 |
03 |
#结果 |
04 |
391942
211.**.151.218 |
05 |
269168
218.**.103.140 |
06 |
142282
112.**.20.133 |
07 |
105460
112.**.25.241 |
08 |
96016
119.**.155.137 |
09 |
89926
112.**.31.16 |
10 |
83113
218.**.200.19 |
11 |
79975
112.**.28.11 |
12 |
79890
119.**.156.14 |
13 |
72041
124.**.110.72 |
2. [代码][Shell/批处理]代码
01 |
#如果想查看某一天的 |
02 |
cat access.log
| grep "07/Nov/2013" | awk '{print
$1}' | uniq -c
| sort -nr
| head -n
10 |
03 |
#结果 |
04 |
3452
60.**.235.88 |
05 |
2297
119.**.195.228 |
06 |
2258
113.**.145.91 |
07 |
1221
123.**.187.223 |
08 |
905
211.**.82.175 |
09 |
899
117.**.5.207 |
10 |
888
112.**.24.202 |
11 |
787
110.**.139.183 |
12 |
576
143.**.5.44 |
13 |
574
125.**.18.21 |
3. [代码][Shell/批处理]代码
01 |
awk '{print
$11}' access.log
| sort | uniq -c
| sort -nr
| head -n
10 |
02 |
03 |
#结果 |
04 |
05 |
1420617 "http://***.com/forum.php" |
06 |
844547 "http://***.com/?fromuid=1180" |
07 |
760045 "http://www.***.com/" |
08 |
697515 "http://www.***.com/forum.php" |
09 |
436309 "http://www.***.com/?fromuid=1080" |
10 |
279609 "http://www.***.com/?fromuid=21" |
11 |
172784 "http://www.***.com/?fromuid=2123" |
12 |
108563 "http://www.***.com/?fromuid=1090" |
13 |
86906 "http://www.***.com/plugin.php?id=sanree_brand:sanree_brand" |
14 |
80661 "http://www.***.com/plugin.php?id=sanree_brand_goods:sanree_brand_goods" |