收藏 分销(赏)

Linux网络管理员认证操作题.doc

上传人:仙人****88 文档编号:11731206 上传时间:2025-08-11 格式:DOC 页数:6 大小:62.50KB 下载积分:10 金币
下载 相关 举报
Linux网络管理员认证操作题.doc_第1页
第1页 / 共6页
Linux网络管理员认证操作题.doc_第2页
第2页 / 共6页


点击查看更多>>
资源描述
<p>Linux网络管理员认证操作题 Linux网络管理员认证操作题 1. 显示当前目录路径,然后显示该当前目录下的所有文件。 pwd ls -a 2. 创建用户lupa。并设此用户密码为123456 useradd &nbsp;lupa passwd &nbsp;lupa 3. 增加两个组帐号group1,group2,并指定组帐号ID分别为10100,10101 groupadd -g 10100 group1 groupadd -g 10101 group2 4. (1)在caozuo目录下创建一文件夹aa,修改此文件夹的权限使所有用户都有读写的权限。(以数字方式设定) &nbsp; &nbsp; [root@localhost caozuo]# mkdir aa [root@localhost caozuo]# chmod 666 aa &nbsp; (2)在考生目录下建立一个文件test_5,设置该文件的权限为“-rwxrw-r--”(要求用数字方式)。 [root@localhost caozuo]# cd .. [root@localhost考生目录]# touch test_5 [root@localhost考生目录]# chmod 764 test_5 5. 请安下列要求进行操作 (1)新建普通用户ray,设置该用户的密码为123456,并转为ray用户登录 (2)查看/etc路径下的所有内容 (3)查看文件/etc/hosts的内容 useradd &nbsp;ray passwd &nbsp;ray su ray ls -a /etc/ cat /etc/hosts 6. 建立帐户test,设置其密码为lupaworld,并设置test用户主目录为/var. useradd &nbsp;-d &nbsp;/var &nbsp;test passwd test 7.在考生目录下,创建一文件夹为test,再在此文件夹中创建两个空文件aa与bb,最后将其打包为test.tar.gz [root@localhost caozuo]# cd .. [root@localhost 考生目录]# mkdir test cd test [root@localhost test]# &nbsp;touch aa bb cd .. [root@localhost 考生目录]# tar -cvf test.tar test gzip test.tar 8. 检查是否已经安装Mysql服务器,并查看Mysql服务状态 rpm -qa|grep mysql service mysqld status 9. 查看Apache的并发请求数及其TCP连接状态 &nbsp; &nbsp;ps -ef |grep httpd |wc -l 10. (1)在考生目录下,用一条命令即可创建一个目录book及其子目录exam1,将book目录及子目录下的所有文件的属组设置为book。 cd .. mkdir -p book/exam1 groupadd book chgrp -R book book (2)在考生目录下创建一文件夹test3,并在此文件夹中创建aaa文件,将文件夹test3下的所有文件及文件夹的属主设置为book;而属组为book。 cd .. mkdir test3 touch test3/aaa useradd book chown -R book.book test3 11. 在考生目录下,创建一文件夹share,并在share文件夹中,创建aa和bb文件,给share文件夹打包成hello.zip,接着删除share文件夹,最后,解压hello.zip成share文件夹。 cd .. mkdir share cd share touch aa bb cd .. zip -r hello.zip share/ rm -rf share unzip hello.zip 12. 显示/var/boot.log文件中的每行从开头算起 1到6 的文符 &nbsp; &nbsp;[root@localhost caozuo]# &nbsp; &nbsp;cut -c1-6 /var/log/boot.log 13. 显示系统中剩余及已用的物理内存、交换内存、共享内存和内核缓冲区 &nbsp; [root@localhost caozuo]# &nbsp; free 14. 查找并显示/etc目录下的所有以&quot;ht&quot;开头的文件 &nbsp;find /etc/ -name &quot;ht*&quot; 15. 查看80端口被哪些程序占用 &nbsp;lsof -i:80 16. 用uname命令,查看当前系统的完整系统名和版本栏,并将结果写入考生目录下的“systeminfo.txt”文件中 cd &nbsp;.. uname -a&gt; systeminfo.txt 17. (1)在终端环境下,查看是否安装安装DHCP服务器,并查看包括“DHCP”字符的包 rpm -qa|grep dhcp (2)在终端环境下,查看是否安装DHCP服务器,同时将查询结果定向至log.txt。 rpm -qa|grep dhcp&gt;log.txt 18. 在终端上,每隔5秒显示一次内存使用情况,并以字节为单位 free &nbsp;-b &nbsp;-s5 19. 当系统运行级别处于5时,不自动开启sshd服务,运行级别为3、4、5时,自动开启smb与atd服务 &nbsp; &nbsp;chkconfig - -level 5 sshd off chkconfig - -level 345 smb on chkconfig - -level 345 atd on 20. 在考生目录下创建一文件test_9,将其写保护,不允许误删除与修改 cd .. touch test_9 chattr +i test_9 21. 在考生目录下新建file1和file2文件,要求2文件内容不一样(具体内容不限),使用新版的上下文格式进行比较。 cd .. touch file1 file2 vi file1(或gedit file1) vi file2(或gedit file2) diff -u file1 file2 22. 查看系统中所有服务及其端口号列表,并用命令检测端口22被什么服务占用 cat /etc/services lsof -i:22 23. 查看/home目录所在有磁盘空间,以K、M、G为单位 (查看目录的空间,可以用du命令;查看某程序正在使用的进程可以用fuser命令。)故,此题的操作如下: du -sh /home 24. 用ps查看当前系统中所有程序状况,以用户为主的格式来显示,并将查询结果写入考生目录下的“pl.txt”文件中。 cd .. ps aux&gt; pl.txt 25. 创建一个软链接,将/etc/logrotate.d/messages日志文件,软链接至考生目录下,并命名为exam.log。 cd .. ln -s /etc/logrotate.d/messages exam.log 26. 在考生目录下生成一个补丁文件,命名为file.patch,在考生目录下新建文件file1和file2,file1的文件内容为“helloworld”,file2 的文件内容为“helloworld123456”,再给file1文件打上补丁。 cd .. touch file1 file2 gedit file1 gedit file2 diff file1 file2&gt;file.patch &nbsp;//生成补丁 patch file1&lt;file.patch &nbsp; &nbsp; //打补丁 27. 查看系统的开机自动启动的服务,系统运行级别为5时,设置开机自动启动服务NFS。 chkconfig - -list &nbsp; &nbsp; &nbsp;//查看 chkconfig - -level 5 nfs on &nbsp;//设置 28. 查看与gcc程序相关的所库文件 ldd /usr/bin/gcc 29. 在考生目录下创建一文件test1,一部分代码如下所示,在下划处填写需要的代码,实现的功能是求两个数的差,这两个数用位置参数传入,最后输出结果。(注:不能修改文件中的以下代码。) 代码如下: &nbsp; &nbsp; &nbsp; &nbsp;cd .. &nbsp; &nbsp; &nbsp; &nbsp;mkdir test1 &nbsp; &nbsp; &nbsp; &nbsp;gedit test1 -------------------------------------------- add( ) { &nbsp;a=$1 &nbsp;b=$2 &nbsp; &nbsp;//expr命令将它的参数当作一个表达式来求值, __ z=`expr $a &nbsp;- $b`_______ &nbsp;(注:此下划线处补充需要语句) echo &quot;The sum is $z&quot; } add &nbsp;__$1 $2________(注:此下划线处补充需要语句) 30. 在考生目录下创建文件test3,部分代码如下所示,在下划线处填写代码, 实现的功能是比较两个数字是否相等。(注:不能修改以下提供的代码) 代码如下: &nbsp; &nbsp; &nbsp; cd &nbsp;.. &nbsp; &nbsp; &nbsp; mkdir test3 &nbsp; &nbsp; &nbsp; gedit test3 ----------------------------------------------------- read x y if test $x -eq $y &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; then &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;_$x = = $y&quot; &nbsp;----(注:此双引号下补所需语句) else &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;_$X != $y_&quot; &nbsp;-----(注:此双引号下补所需语句) fi 31. 在考生目录创建文件test2,部分代码如下,在下划线处填写代码,实现的功能是从键盘读入两个字符串,判断这两个字符串是否相等。(注:不能修改以下提供的代码。) 代码如下: &nbsp; &nbsp;cd &nbsp;.. &nbsp; &nbsp;mkdir test2 gedit test2 --------------------- read &nbsp;ar1 &nbsp;__ read ar2____________(注:此下划线处补所需要语句) [ &quot;$ar1&quot; &nbsp;= &nbsp;&quot;$ar2&quot; ] &nbsp; &nbsp; &nbsp;__ echo $?____________(注:此下划线处补所需要语句) 32. 在考生目录下创建文件test4,部分代码如下所示,要求在下划线处填写相应代码,实现的功能是用while循环求1到100的和。(注:不能修改以下提供的代码.) 代码如下: &nbsp; &nbsp; &nbsp; &nbsp; cd &nbsp;.. &nbsp; &nbsp; &nbsp; &nbsp; mkdir test4 &nbsp; &nbsp; &nbsp; &nbsp; gedit test4 ---------------------------------------------------- total=0 &nbsp; &nbsp; &nbsp; &nbsp;num=0 &nbsp; &nbsp; &nbsp; &nbsp;while (_num &lt;= 100_) ;do &nbsp; &nbsp; &nbsp; &nbsp;_ total= ` expr $total + $num `__(注:下划线处需要补充语句) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ((num+=1)) &nbsp; &nbsp; &nbsp; done &nbsp; &nbsp; &nbsp; echo &quot; The result is $total &quot; 33. 在考生目录下创建一目录linux,并创建一个空白文件test,在此文件中写入一段程序,实现的功能是:程序执行时从键盘读入目录名linux,然后显示这个目录的所有文件的信息. &nbsp; cd &nbsp;.. mkdir &nbsp; linux cd &nbsp; &nbsp;linux touch &nbsp;test gedit test ----------------------------------------------- #!/bin/sh echo &nbsp;&quot; Input your dirname:linux from keyboard &quot; read dir if [ &nbsp;-d &nbsp;$dir ] then &nbsp;ls –l $dir fi ------------------------------------------------------ chmod u+x test ./test 34. 查看最近几次成功登录的事件和最后一次不成功的登录,然后,显示最后一个登录到系统的用户 lastlog &nbsp; &nbsp;//查看最近几次成功登录的事件和最后一次不成功的登录 last &nbsp; &nbsp; &nbsp;//查看最后一次登录到系统的用户 35. 在终端环境下操作:(1)、在/home目录下新建目录software &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(2)、并拷贝/etc目录下所有以h开头的文件及目录,拷贝到software中; mkdir /home/software cp -rf /etc/h* /home/software - 6 - 陈宁 第 - 6 - 页 2025-7-19</p>
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 考试专区 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服