每日一题20180325

发布时间:2024-11-11 点击:77
一、题目 1.1 统计
处理以下文件内容,将域名取出并根据域名进行计数排序处理:(百度和sohu面试题)
http://www.etiantian.org/index.html http://www.etiantian.org/1.html http://post.etiantian.org/index.html http://mp3.etiantian.org/index.html http://www.etiantian.org/3.html http://post.etiantian.org/2.html
要求结果
mp3.etiantian.org 1 post.etiantian.org 2 www.etiantian.org 3 1.2
统计企业工作中高并发web服务器不同网络连接状态对应的数量
proto recv-q send-q local-address foreign-address state tcp 0 0 0.0.0.0:3306 0.0.0.0:* listen tcp 0 0 0.0.0.0:80 0.0.0.0:* listen tcp 0 0 127.0.0.1:9000 0.0.0.0:* listen tcp 0 0 coolshell.cn:80 124.205.5.146:18245 time_wait tcp 0 0 coolshell.cn:80 61.140.101.185:37538 fin_wait2 tcp 0 0 coolshell.cn:80 110.194.134.189:1032 established tcp 0 0 coolshell.cn:80 123.169.124.111:49809 established tcp 0 0 coolshell.cn:80 116.234.127.77:11502 fin_wait2 tcp 0 0 coolshell.cn:80 123.169.124.111:49829 established tcp 0 0 coolshell.cn:80 183.60.215.36:36970 time_wait tcp 0 4166 coolshell.cn:80 61.148.242.38:30901 established tcp 0 1 coolshell.cn:80 124.152.181.209:26825 fin_wait1 tcp 0 0 coolshell.cn:80 110.194.134.189:4796 established tcp 0 0 coolshell.cn:80 183.60.212.163:51082 time_wait tcp 0 1 coolshell.cn:80 208.115.113.92:50601 last_ack tcp 0 0 coolshell.cn:80 123.169.124.111:49840 established tcp 0 0 coolshell.cn:80 117.136.20.85:50025 fin_wait2 tcp 0 0 :::22 :::* listen 1.3
分析图片服务日志,把日志(每个图片访问次数*图片大小的总和)排行,取top10,也就是计算每个url的总访问大小
59.33.26.105 – – [08/dec/2010:15:43:56 0800] "get /static/images/photos/2.jpg http/1.1" 200 11299 "http://oldboy.blog.51cto.com/static/web/column/17/index.shtml?courseid=43" "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1; .net clr 2.0.50727; .net clr 3.0.4506.2152; .net clr 3.5.30729)" 59.33.26.105 – – [08/dec/2010:15:43:56 0800] "get /static/images/photos/2.jpg http/1.1" 200 11299 "http://oldboy.blog.51cto.com/static/web/column/17/index.shtml?courseid=43" "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1; .net clr 2.0.50727; .net clr 3.0.4506.2152; .net clr 3.5.30729)" 59.33.26.105 – – [08/dec/2010:15:44:02 0800] "get /static/flex/vedioloading.swf http/1.1" 200 3583 "http://oldboy.blog.51cto.com/static/flex/adobevideoplayer.swf?width=590&height=328&url=/`dynamic`/2" "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1; .net clr 2.0.50727; .net clr 3.0.4506.2152; .net clr 3.5.30729)" 124.115.4.18 – – [08/dec/2010:15:44:15 0800] "get /?= http/1.1" 200 46232 "-" "-" 124.115.4.18 – – [08/dec/2010:15:44:25 0800] "get /static/js/web_js.js http/1.1" 200 4460 "-" "-" 124.115.4.18 – – [08/dec/2010:15:44:25 0800] "get /static/js/jquery.lazyload.js http/1.1" 200 1627 "-" "-" 1.4
假如现在有个文本,格式如下:
a 1 b 3 c 2 d 7 b 5 a 3 g 2 f 6 d 9
即左边是随机字母,右边是随机数字,要求写个脚本使其输出格式为:
a 4 b 8 c 2 d 16 f 6 g 2
即将相同的字母后面的数字加在一起,按字母的顺序输出。
1.5
1、按单词出现频率降序排序!
2、按字母出现频率降序排序!
the squid project provides a number of resources to assist users design,implement and support squid installations. please browse the documentation and support sections for more infomation 二、答案 2.1
awk -f "/ " \\\'{host[$2] }end{for (i in host) print i,host[i]}\\\’ a.txt | sort -rnk2
分析:
# 01找出域名 awk -f参

阿里云学生服务器到期如何续费
浪潮全新发布5款支持NVIDIA A100 GPU的AI服务器
部署网站买云主机还是服务器的
Tag标签有什么样的优化效果?Tag标签优化浅析
party域名怎么样?值得去注册吗?
域名保护:了解域名国际纠纷的解决机制
申请转出域名愿意补交费用
云服务器ecs是什麽