面试题大全,快来分享哦!
http://www.77cn.com.cn/index.html
http://www.77cn.com.cn/3.html
http://www.77cn.com.cn/2.html
得到如下结果:
域名的出现的次数 域名
3 http://www.77cn.com.cn
2 http://www.77cn.com.cn
1 http://www.77cn.com.cn
可以使用bash/perl/php/c任意一种
3、[root@localhost shell]# cat file | sed e ' s/http:\/\///' e ' s/\/.*//' | sort |
uniq c | sort rn
3 http://www.77cn.com.cn
2 http://www.77cn.com.cn
1 http://www.77cn.com.cn
[root@codfei4 shell]# awk F/ '{print $3}' file |sort r|uniq c|awk '{print
$1"\t",$2}'
3 http://www.77cn.com.cn
2 http://www.77cn.com.cn
1 http://www.77cn.com.cn
19.如果得到随机的字串,长度和字串中出现的字符表可定义,并将字串倒序显示,如
把0123456789作为基准的字串字符表,产生一个6位的字串642031,打印出的字串为
130246,可使用bash/perl/php/c任意一种.
4、[root@localhost ~]# awk v count=6 'BEGIN
{srand();str="0123456789";len=length(str);for(i=count;i>0;i )
marry[i]=substr(str,int(rand()*len),1);for(i=count;i>0;i )
printf("%c",marry[i]);printf("\n");for
(i=0;i<=count;i++) printf("%c",marry[i]);printf("\n")}'
838705
507838
20.如何查看当前Linux系统的状态,如CPU使用,内存使用,负载情况 Linux系统中“/proc”是个伪文件目录,不占用系统空间,及时的反应出内存现在使用的进程情况......其中许多文件都保存系统运行状态和相关信息
对于“/proc”中文件可使用文件查看命令浏览其内容,文件中包含系统特定信息: cpuinfo 主机CPU信息
filesystems 文件系统信息
meminfo 主机内存信息
version Linux内存版本信息