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

上传人:音乐台 文档编号:1986583 上传时间:2019-01-28 格式:DOC 页数:39 大小:252KB
返回 下载 相关 举报
[理学]UNIX试卷及课后习题与答案.doc_第1页
第1页 / 共39页
[理学]UNIX试卷及课后习题与答案.doc_第2页
第2页 / 共39页
[理学]UNIX试卷及课后习题与答案.doc_第3页
第3页 / 共39页
亲,该文档总共39页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《[理学]UNIX试卷及课后习题与答案.doc》由会员分享,可在线阅读,更多相关《[理学]UNIX试卷及课后习题与答案.doc(39页珍藏版)》请在三一文库上搜索。

1、试卷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.

2、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. ca

3、t 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. l

4、evel 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 berts 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

5、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. 6

6、44B. 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 y

7、our 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-zB. 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.

8、 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

9、 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 $ ni

10、ce -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)

11、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 t

12、o 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 up

13、date 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

14、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分)

15、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 *

16、textfileD. grep textfileE. grep * textfile 3. You need to alter the permissions on the directory /home/mrking and all its 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 74

17、4 /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. W

18、hich 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_p

19、rofileE. /.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 fil

20、e2.txtD. cp file1.txt file2.txtE. cpio 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.

21、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以及其子孙目录

22、中的所有文件名后缀为.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 t

23、o 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 parag

24、raph 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 i

25、t 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 newletterD. sed s/bob/Bob/ letter newletterE. sed s/bob.Bob/ letter newletter 4. What run level represents administration mod

26、e?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 /

27、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

28、 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 its associated man pages and any exis

29、ting 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.t

30、xt | 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/ maillogB. for reject in mail log (count) +1C. wc -|/var/log/maillog | grep rejectD. cat /var/log/maillog | grep reject | wc -lE

31、. 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 file 14. Which command will display in reverse order a file that is numbered from 1 to End of Fil

32、e?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.

33、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/

34、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

35、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 systems mounted file systems?A. du -iB. df -iC. ls -iR /D. freein

36、odes 二、多项选择题(在每小题的备选答案中,选出正确的答案,多选或少选都不计分。请将答案填写在答题纸上,每小题2分,共20分)1. You want to configure user quotas for the /home filesystem. Youve installed the quota packages. What else needs to be done to enable the filesystems quotas? Choose all that apply.A. add usrquota to the /etc/fstab options columnB. ru

37、n the quotaon commandC. run the quotacheck -avug commandD. edit the users 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

38、 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. Th

39、e 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 run

40、ning? (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 fil

41、e 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 systems root filesystem? Choose all that apply.A. /mntB. /rootC. /usrD. /varE. /

42、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 processs nice

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


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