欢迎来到三一文库! | 帮助中心 三一文库31doc.com 一个上传文档投稿赚钱的网站
三一文库
全部分类
  • 研究报告>
  • 工作总结>
  • 合同范本>
  • 心得体会>
  • 工作报告>
  • 党团相关>
  • 幼儿/小学教育>
  • 高等教育>
  • 经济/贸易/财会>
  • 建筑/环境>
  • 金融/证券>
  • 医学/心理学>
  • ImageVerifierCode 换一换
    首页 三一文库 > 资源分类 > DOC文档下载  

    [理学]UNIX试卷及课后习题与答案.doc

    • 资源ID:1986583       资源大小:252KB        全文页数:39页
    • 资源格式: DOC        下载积分:6
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录   微博登录  
    二维码
    微信扫一扫登录
    下载资源需要6
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    [理学]UNIX试卷及课后习题与答案.doc

    试卷A一、单项选择题(在每小题的备选答案中,选出正确的答案。请将答案填写在答题纸上,每小题1分,共20分)1. You want to save vi changes to the file myfile with : w!. but vi complains it can not write to the file. Therefore, you want to check the write permissions on the file. To do this without leaving vi, you type:A. :!ls -l myfileB. :s -l myfileC. esc:ls -l myfileD. :?ls -l myfile 2. What is the proper option to put in /etc/fstab to enable user quotas for a particular partition?A. usrquotaB. userquotaC. userquoatasD. usrquotas 3. Which of the following commands would display the lines containing capital letters from the file "turkey.txt" ?A. cat turkey .txt |wc - |B. grep -n A-Z turkey.txtC. cat turkey.tst |wc -w A-ZD. grep -v A-Z < turkey.txtE. for A-Z in turkey.txt I count 4. What run level represents multi-user?A. 3B. 0C. 1D. 5 5. Which of the following can be used to switch your system to run level 1?A. init 1B. inittab 1C. rlevel 1D. level 1 6. What would the following line accomplish if run as root?chown -R bert /home/bert/*A. Nothing, this command is invalid.B. It would revoke bert's ownership from his home directory to root.C. It would change user ownership of all files in /home/bert to bert.D. It would set the group ownership of the directory /home/bert to bert'.E. It would set ownership of all files and subdirectories in /home/bert to bert. 7. If you set the umask to 022, by default what permissions will your files have?A. 0220B. 0557C. 0644D. 0755 8. What are the default permissions for the Red Hat /etc/passwd file?A. 644B. 640C. 400D. 641E. 440 9. How can you set the SGID on a file called happylinuxexaminator?A. chmod u+s happylinuxexaminatorB. chmod g+s happylinuxexaminatorC. chmod o+s happylinuxexaminatorD. chmod u+t happylinuxexaminator 10. Which one of the following programs will only find files that are in your PATH?A. locateB. slocateC. whichD. find 11. To convert all uppercase letters in a stream to lowercase, pipe the stream into which command:A. tr 'A-Z' 'a-z'B. tac A-Z a- zC. sed /A-Z/a-zD. sed -tolowerE. conv A-Z a-z 12. What utility would you use to remove/display columns from each line of a file?A. pwdB. colC. cutD. tailE. extract 13. Which of the commands will show you only the middle 10 lines of a 30 line text file named textfile?A. head -n 11-20 textfileB. head -n 20 textfile | tailC. tail -n 11-20D. cat textfile | pr -n 11-20E. nl -n 11-30 textfile 14. Which of these commands would report how many total accounts (including special accounts) there are?A. count /etc/passwdB. nl /etc/passwd | headC. wc -users /etc/passwdD. wc -lines /etc/passwdE. expand -lines /etc/passwd 15. You run the following commands:user prompt $ nice -n 1 program1user prompt $ nice -n 5 program2user prompt $ nice -n 10 program3Which of the programs started will have the highest priority?A. program1B. program2C. program3 16. When the kill command is given with only the PIP number of the process to kill (as in 'kill 1234'), this corresponds to which type of kill signal?A. 2 (SIGINT)B. 1 (SIGHUP)C. 9 (SIGKILL)D. 3 (SIGQUIT)E. 15 (SIGTERM) 17. What key sequence will suspend the current process and return you to a shell prompt?A. ctrl-zB. ctrl-cC. ctrl-xD. ctrl-d 18. You have a system that uses LILO from the Master Boot Record. You have just recompiled a new kernel. You already have a backup kernel setup to boot from LILO so you overwrite your existing kernel with new kernel image using the same name and location. When you reboot, you find that the system does not boot. What is likely to be the problem?A. The new kernel image is above the 1024 cylinder and therefore cannot be loaded.B. You did not update your/etc/lilo.conf file to boot the new kernel.C. You need to boot the new kernel with a boot floppy to restore the old kernel.D. You rebooted before re-installing LILO in the Master Boot Record. 19. Tamika is planning the partition table for her new workstation. Assuming she will give each of the following directories its own partition, which partition should be the largest?A. /usrB. /libC. /rootD. /bin 20. What command with switches will display the disk utilization for all mounted file systems?A. dfB. vmstatC. duD. topE. free 二、多项选择题(在每小题的备选答案中,选出正确的答案,多选或少选都不计分。请将答案填写在答题纸上,每小题2分,共20分)1. Select all the ways of exiting and saving a vi session.A. :wqB. :wC. :ZZD. Shift zzE. :xF. :exit 2. A user needs to search a file for lines that contain the asterisk (*) character. Which grep search command will accomplish this? Choose all that apply.A. grep * textfileB. grep '*' textfileC. grep "*" textfileD. grep <*> textfileE. grep "'*'" textfile 3. You need to alter the permissions on the directory /home/mrking and all it's contents to match the following permissions. drwxr-r- Which of these commands with options and arguments will accomplish this? Choose two.A. chmod 0744 /home/mrking -RB. chmod 744 /home/mrking/*C. chmod -R u=rwx,g=r,o=r /home/mrkingD. chmod u+rwx,g+r,o+r /home/mrking 4. What will the command "kill -HUP 1354" do? Select all the applyA. The same as kill -9 1354B. The same as kill 15 1354C. The same as kill -15 1354D. The same as kill -SIGHUP 1354E. The same as kill -1 1354 5. Which THREE of the following commands are used when setting up and accessing a new file system on the hard drive? (select three correct answers)A. fsckB. mkfsC. mountD. fdiskE. format 6. Which of the following are executed ONLY during a Login sessionA. /etc/profileB. /etc/bashrcC. /.bashrcD. /.bash_profileE. /.bash_logout 7. Which of the following directories would be the least likely to need backing up? Choose Two.A. /usrB. /etcC. /homeD. /tmpE. /swap 8. Which of the following will copy file1.txt to file2.txt? Choose Two.A. cat file1.txt > file2.txtB. cat file1.txt | file2.txtC. cp file1.txt > file2.txtD. cp file1.txt file2.txtE. cpio < file1.txt > file2.txt 9. Which of the following commands could be used to see which processes are currently running?(Select all that apply.)A. wB. psC. topD. procE. lsproc 10. Man pages may be written about which of the following?(Select all that apply)?A. user commandsB. system policiesC. superuser comamndsD. programming librariesE. configuration commands 三、简答题(请将答案填写在答题纸上,每小题2分,共10分),简述下列常用UNIX命令完成什么功能。1. ls2. find3. vi4. grep5. kill 四、 问答题(每题5分,共20分)1命令ifconfig有很多选项,如何得知使用哪个选项可以修改系统当前的ip? 2用户tux1有一个重要的文件report.txt,为保证该文件不会被无意地修改,移走和删除,应当采取什么措施? 3 如何检索目录/src以及其子孙目录中的所有文件名后缀为.c和.h文件,查找哪些文件中含有字符串UDP,并列出在这文件中的行号。 4 统计出由用户tux1创建并且正在运行的进程数目。 五、论述题(每题10分,共10分)1.AIX的LVM包括哪些组件,它们之间有什么关系,LVM和传统的存储方式相比有什么优点?六、编程题 (每题10分,共20分)1编写一段脚本程序,可以从键盘输入三个整数A,B,C,并且求出A*(B+C)的值。2编写一段bash程序,使用菜单界面,实现目录的备份和恢复。试卷B一、单项选择题(在每小题的备选答案中,选出正确的答案。请将答案填写在答题纸上,每小题1分,共20分)1. After starting vi to edit an existing text file. you press 'A' (shift + a). This will let you:A. insert text at the end of the current lineB. insert text at the end of the current sentenceC. insert text after your current cursor positionD. insert text at the end of the fileE. insert text at the end of your current paragraph 2. What is the proper option to put in /etc/fstab to enable group quotas for a particular partition?A. groupquotaB. grpquotaC. groupquoatasD. grpquotas 3. You have created a really long letter and after you are done you notice that you used the name "Bob" many times but you forgot to capitalize it in many instances. Which command would replace "bob" with "Bob" in all instances and generate a new letter for printing?A. sed '/bob/Bob' letter > newletterB. sed s/bob/Bob/ letter < newletterC. sed 's/bob/Bob' letter > newletterD. sed 's/bob/Bob/' letter > newletterE. sed 's/bob.Bob/' letter > newletter 4. What run level represents administration mode?A. 0B. 1C. 6D. 5 5. What file does init processes use as its control file?A. /etc/inittabB. /etc/procC. /etc/initD. /etc/initproc 6. Which of the following commands makes /bin/foo executable by everyone but only writable by its owner ?A. chmod 557 /bin/fooB. chmod o+rwx,a+rx /bin/fooC. chown 557 /bin/fooD. chmod 755 /bin/foo 7. Which of the following commands will change the owner of the file/bin/foo from the foo user to the bar user without affecting group ownership?A. chown /bin /foo barB. chown bar /bin/fooC. chown bat. foo /bin/feeD. chown foo. bar/bin/foo 8. Your umask is set to 002. If you create a new file, what will the permission of the new file be?A. -rw-rw-r-B. -rwxrwx-w-C. -w-D. -rwxrwxr-x 9. What are the default permissions on the Red Hat /etc/shadow file?A. 644B. 600C. 400D. 444E. 640 10. What command can find the program file "bar" and it's associated man pages and any existing source files, but not return all files that have "bar" in the command name or path?A. whereisB. findC. locateD. aproposE. whatis 11. Which of the following would copy the file file1, txt to file2, txt?A. cp file1.txt | file2.txtB. cat file1.txt | file2.txtC. cat file1.txt > file2.txtD. copy file1.txt | file2.txtE. cat | file1.txt | file2.txt 12. Which line below would count the total number of lines with the word "reject" in /var/log/mail log?A. wc -| 'reject/ var/ log/ maillog'B. for "reject" in mail log (count) +1C. wc -|/var/log/maillog | grep 'reject'D. cat /var/log/maillog | grep 'reject' | wc -lE. cat /var/log/maillog | grep 'reject' | wc -r 13. To change all lower case characters in a file to upper case, pick the correct command.A. tr 'a-z' 'A-Z' fileB. tr a-z A-Z <fileC. tr "a-z" "A-Z" fileD. tr 'a-z' 'A-Z' < fileE. tr a-z A-Z > file 14. Which command will display in reverse order a file that is numbered from 1 to End of File?A. cat file | nl | prB. cat file | nl | tacC. cat file | tac | nlD. cat file | pr -n | reverseE. None of the above 15. What is the disadvantage of using the command kill -9 ?A. A core dump file will be created.B. It affects the entire process group.C. It makes excessive use of system resources.D. The action can be blocked by buggy or malicious processes.E. The affected process is unable to clean up before exiting. 16. To keep a process running after you logged out, you start it with the command:A. nohupB. fgC. liveD. sh 17. Where can lilo place boot code?A. The boot ROMB. The boot RAMC. The/boot partitionD. The MBR on a hard drive 18. When partitioning a disk with more than 1024 cylinders, which of the following could affect the systems ability to boot?A. Location of LILO on diskB. Location of /boot on diskC. Location /var on diskD. Disk transfer rateE. Disk seek time 19. Identify the proper device for the third partition, on the second hard disk, on the first IDE controller on a PC system.A. /dev/hdb3B. /dev/hd1b3C. /dev/hdc1b3D. /dev/hdc1d2p3 20. Which command will show the number of free and used inodes for your system's mounted file systems?A. du -iB. df -iC. ls -iR /D. freeinodes 二、多项选择题(在每小题的备选答案中,选出正确的答案,多选或少选都不计分。请将答案填写在答题纸上,每小题2分,共20分)1. You want to configure user quotas for the /home filesystem. You've installed the quota packages. What else needs to be done to enable the filesystem's quotas? Choose all that apply.A. add usrquota to the /etc/fstab options columnB. run the quotaon commandC. run the quotacheck -avug commandD. edit the user's quota settingsE. remount the file system 2. One of the lines in the output from the command 'ls -l /home/poms' is:drwxrwsr-x 3 deve1 poms 1024 Oct 22 16:28 fooThe output from the command groups bubba is:bubba : bubba poms actsIf user bubba executes the command touch /home/poms/foo/bar, which TWO of the following must be true?A. The group for/home/poma/foo/bar will be poms.B. The owner for/home/poma/foo/bar will be dove/.C. The owner for/home/poma/foo/bar will be bubba.D. The group for /home/poma/foo/bar will be bubba.E. The permissions for/home/poms/foo/bar will allow group read. 3. What TWO permissions must a user have in order to run a shell script?A. readB. writeC. executeD. browse on the directoryE. users cannot run shell scripts 4. Which TWO programs will allow you to change the priority of a program already running? (Select TWO that apply.)A. topB. niceC. niceitD. reniceE. chnice 5. Which THREE of the following commands are used when setting up and accessing a new file system on the hard drive? (select three correct answers)A. fsckB. mkfsC. mountD. fdiskE. format 6. What two things does the /etc/fstab file contain references to?A. File SystemsB. Mount PointsC. User OptionsD. File System DefaultsE. File System Permissions 7. According to the Filesystem Heirarchy Standard, what directory trees are considered optional on a system's root filesystem? Choose all that apply.A. /mntB. /rootC. /usrD. /varE. /opt 8. What steps need to be performed, to make a new disk accessible to users?A. fdiskB. mkfsC. mountD. statE. quotaon 9. Which of the following are valid ways of getting a list of all processes running on the system?(Select all tha apply)?A. ps fuB. ps axC. pstreeD. pstree -aE. echo /proc/0-9* 10. Which of the following statements are true?(Select all that apply.)A. The default "nice" priority value is 0.B. "Nice" priority values range from 0 to 20.C. Lower "nice" priority values signify greater priority.D. Only the superuser may assign a process maximum priority.E. Setting a process's "nice"

    注意事项

    本文([理学]UNIX试卷及课后习题与答案.doc)为本站会员(音乐台)主动上传,三一文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    经营许可证编号:宁ICP备18001539号-1

    三一文库
    收起
    展开