linux运维命令综合考试及参考答案20110605
2012-12-14 12:15
537 查看
linux运维初级班课前综合考试及参考答案20110605
#########################################################
#《老男孩linux就业培训中心-初级班第七期课前考试及课上讲解
#LINUX命令实战抽查考试
#date:2011-06-05
#出题人:老男孩
#QQ:31333741 MAIL:oldboy521@hotmail.com
#blog: http://oldboy.blog.51cto.com
#psite: http://oldboy.cc(即将开放)
##########################################################
650) this.width=650;" alt="" src="http://img1.51cto.com/attachment/201106/213311348.jpg" border="0" />
过程命令:
[root@http-server tmp]# cat ett.txt |tr "\n" "+"
1+2+3+4+5+6+7+8+9+10+[root@http-server tmp]# cat ett.txt |tr "\n" "+"|sed 's/\+$/\n/'
1+2+3+4+5+6+7+8+9+10
[root@http-server tmp]# cat ett.txt |tr "\n" "+"|sed 's/\+$/\n/'
1+2+3+4+5+6+7+8+9+10
[root@http-server tmp]# cat ett.txt |tr "\n" "+"|sed 's/\+$/=\n/'
1+2+3+4+5+6+7+8+9+10=
[root@http-server tmp]# cat ett.txt |tr "\n" "+"|sed 's/\+$/=\n/'|bc
(standard_in) 1: parse error
[root@http-server tmp]# cat ett.txt |tr "\n" "+"|sed 's/\+$/\n/'|bc
55
问题2:请获取www.baidu.com 的头(header)信息(考察curl命令)
1.即需要得到如下结果: 请给出命令。
HTTP/1.1 200 OK
Date: Sat, 04 Jun 2011 06:22:39 GMT
Server: BWS/1.0
Content-Length: 7492
Content-Type: text/html;charset=gb2312
Cache-Control: private
Expires: Sat, 04 Jun 2011 06:22:39 GMT
Set-Cookie: BAIDUID=80F597135ACBA8EF3B4B6F02EEE99C0D:FG=1; expires=Sat, 04-Jun-41 06:22:39 GMT; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Connection: Keep-Alive
解答:
[root@http-server tmp]# curl -I www.baidu.com
HTTP/1.1 200 OK
Date: Sat, 04 Jun 2011 07:08:22 GMT
Server: BWS/1.0
Content-Length: 7492
Content-Type: text/html;charset=gb2312
Cache-Control: private
Expires: Sat, 04 Jun 2011 07:08:22 GMT
Set-Cookie: BAIDUID=17CDDACA35B51E142D1DA796972BEF3B:FG=1; expires=Sat, 04-Jun-41 07:08:22 GMT; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Connection: Keep-Alive
[root@http-server tmp]# curl -I http://www.baidu.com
HTTP/1.1 200 OK
Date: Sat, 04 Jun 2011 07:08:30 GMT
Server: BWS/1.0
Content-Length: 7492
Content-Type: text/html;charset=gb2312
Cache-Control: private
Expires: Sat, 04 Jun 2011 07:08:30 GMT
Set-Cookie: BAIDUID=899D297BCA6475E94BE17E829B6D46BA:FG=1; expires=Sat, 04-Jun-41 07:08:30 GMT; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Connection: Keep-Alive
2.请用一条命令 取得 字符串 HTTP/1.1 200 OK 请给出命令(这个是难点)。
解答:
[root@http-server tmp]# curl -I http://www.baidu.com|head -1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 7492 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
HTTP/1.1 200 OK
[root@http-server tmp]# curl -I http://www.baidu.com|grep 200
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (52) Empty reply from server
[root@http-server tmp]# curl -I -s http://www.baidu.com|head -1
HTTP/1.1 200 OK
问题3:一个目录ett下 有3个文件 a,b,c
请打包整个ett目录,但是要排除C文件,即不打包c文件。(考察tar命令)
解答:见单独的tar排除打包总结
tar排除打包总结(19:54 2009-3-19)
man tar:
--exclude PATTERN
exclude files based upon PATTERN
-X, --exclude-from FILE
exclude files listed in FILE
测试准备:
cd /
mkdir -p /test/baoliu
mkdir -p /test/paichu
touch exceptlist;echo "paichu">exceptlist
测试开始:
1、--exclude参数
cd /
tar zcvf paichu.tar.gz ./test --exclude=test/paichu
./test/
./test/baoliu/
2、X 或--exclude-from参数
cd /
[root@oldboy /]# cat exceptlist
paichu
[root@oldboy /]# tar zcvfX paichuX.tar.gz /exceptlist ./test
./test/
./test/baoliu/
tar zcvf oldboy51-100916.tar.gz ./oldboy --exclude=oldboy/logs
本文出自 “老男孩的linux博客” 博客,请务必保留此出处http://oldboy.blog.51cto.com/2561410/584503
#########################################################
#《老男孩linux就业培训中心-初级班第七期课前考试及课上讲解
#LINUX命令实战抽查考试
#date:2011-06-05
#出题人:老男孩
#QQ:31333741 MAIL:oldboy521@hotmail.com
#blog: http://oldboy.blog.51cto.com
#psite: http://oldboy.cc(即将开放)
##########################################################
650) this.width=650;" alt="" src="http://img1.51cto.com/attachment/201106/213311348.jpg" border="0" />
过程命令:
[root@http-server tmp]# cat ett.txt |tr "\n" "+"
1+2+3+4+5+6+7+8+9+10+[root@http-server tmp]# cat ett.txt |tr "\n" "+"|sed 's/\+$/\n/'
1+2+3+4+5+6+7+8+9+10
[root@http-server tmp]# cat ett.txt |tr "\n" "+"|sed 's/\+$/\n/'
1+2+3+4+5+6+7+8+9+10
[root@http-server tmp]# cat ett.txt |tr "\n" "+"|sed 's/\+$/=\n/'
1+2+3+4+5+6+7+8+9+10=
[root@http-server tmp]# cat ett.txt |tr "\n" "+"|sed 's/\+$/=\n/'|bc
(standard_in) 1: parse error
[root@http-server tmp]# cat ett.txt |tr "\n" "+"|sed 's/\+$/\n/'|bc
55
问题2:请获取www.baidu.com 的头(header)信息(考察curl命令)
1.即需要得到如下结果: 请给出命令。
HTTP/1.1 200 OK
Date: Sat, 04 Jun 2011 06:22:39 GMT
Server: BWS/1.0
Content-Length: 7492
Content-Type: text/html;charset=gb2312
Cache-Control: private
Expires: Sat, 04 Jun 2011 06:22:39 GMT
Set-Cookie: BAIDUID=80F597135ACBA8EF3B4B6F02EEE99C0D:FG=1; expires=Sat, 04-Jun-41 06:22:39 GMT; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Connection: Keep-Alive
解答:
[root@http-server tmp]# curl -I www.baidu.com
HTTP/1.1 200 OK
Date: Sat, 04 Jun 2011 07:08:22 GMT
Server: BWS/1.0
Content-Length: 7492
Content-Type: text/html;charset=gb2312
Cache-Control: private
Expires: Sat, 04 Jun 2011 07:08:22 GMT
Set-Cookie: BAIDUID=17CDDACA35B51E142D1DA796972BEF3B:FG=1; expires=Sat, 04-Jun-41 07:08:22 GMT; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Connection: Keep-Alive
[root@http-server tmp]# curl -I http://www.baidu.com
HTTP/1.1 200 OK
Date: Sat, 04 Jun 2011 07:08:30 GMT
Server: BWS/1.0
Content-Length: 7492
Content-Type: text/html;charset=gb2312
Cache-Control: private
Expires: Sat, 04 Jun 2011 07:08:30 GMT
Set-Cookie: BAIDUID=899D297BCA6475E94BE17E829B6D46BA:FG=1; expires=Sat, 04-Jun-41 07:08:30 GMT; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Connection: Keep-Alive
2.请用一条命令 取得 字符串 HTTP/1.1 200 OK 请给出命令(这个是难点)。
解答:
[root@http-server tmp]# curl -I http://www.baidu.com|head -1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 7492 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
HTTP/1.1 200 OK
[root@http-server tmp]# curl -I http://www.baidu.com|grep 200
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (52) Empty reply from server
[root@http-server tmp]# curl -I -s http://www.baidu.com|head -1
HTTP/1.1 200 OK
问题3:一个目录ett下 有3个文件 a,b,c
请打包整个ett目录,但是要排除C文件,即不打包c文件。(考察tar命令)
解答:见单独的tar排除打包总结
tar排除打包总结(19:54 2009-3-19)
man tar:
--exclude PATTERN
exclude files based upon PATTERN
-X, --exclude-from FILE
exclude files listed in FILE
测试准备:
cd /
mkdir -p /test/baoliu
mkdir -p /test/paichu
touch exceptlist;echo "paichu">exceptlist
测试开始:
1、--exclude参数
cd /
tar zcvf paichu.tar.gz ./test --exclude=test/paichu
./test/
./test/baoliu/
2、X 或--exclude-from参数
cd /
[root@oldboy /]# cat exceptlist
paichu
[root@oldboy /]# tar zcvfX paichuX.tar.gz /exceptlist ./test
./test/
./test/baoliu/
tar zcvf oldboy51-100916.tar.gz ./oldboy --exclude=oldboy/logs
本文出自 “老男孩的linux博客” 博客,请务必保留此出处http://oldboy.blog.51cto.com/2561410/584503
相关文章推荐
- linux运维初级班课前综合考试及参考答案20110529
- linux运维初级班shell脚本编程考试及参考答案20110523
- linux运维初级班shell脚本编程考试及参考答案20110523
- 20170117L07-1-2老男孩linux运维实战培训-初级第七节节课课前考试第一题route命令讲解
- linux运维初级课前实战随机考试题含答案(笔试+上机)
- linux运维初级课前实战随机考试题及答案20110522
- 3.请执行命令取出linux中eth0的IP地址(考试题答案系列)
- 大学考试的LINUX试题参考答案
- linux运维初级班shell脚本编程测试及参考答案
- linux运维初级课前实战随机考试题含答案(笔试+上机)
- 10个有用的Linux命令面试问题及答案
- Linux tcpdump命令详解,BPF过滤规则参考
- linux面试题与参考答案(转)
- LINUX 命令参考
- 老男孩教育Linux运维39期第四周考试题
- 非常全的linux面试笔试题及参考答案
- 2007年9月全国计算机等级考试三级信息管理笔试试卷含参考答案
- 常用Linux运维命令
- linux基本运维命令
- 【APP】Linux运维利器--Find命令