unix管理与开发期末考试试卷(英文版).doc

上传人:小小飞 文档编号:5175782 上传时间:2020-02-15 格式:DOC 页数:9 大小:96.50KB
返回 下载 相关 举报
unix管理与开发期末考试试卷(英文版).doc_第1页
第1页 / 共9页
unix管理与开发期末考试试卷(英文版).doc_第2页
第2页 / 共9页
unix管理与开发期末考试试卷(英文版).doc_第3页
第3页 / 共9页
unix管理与开发期末考试试卷(英文版).doc_第4页
第4页 / 共9页
unix管理与开发期末考试试卷(英文版).doc_第5页
第5页 / 共9页
亲,该文档总共9页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《unix管理与开发期末考试试卷(英文版).doc》由会员分享,可在线阅读,更多相关《unix管理与开发期末考试试卷(英文版).doc(9页珍藏版)》请在三一文库上搜索。

1、南开大学20132014年度第二学期Unix管理与开发期末考试试卷(考试时间:100分钟 总分100分)院(系) 软件工程 学号 姓名 分数 一选择正确的答案 (每题2分,共20分)1. The signs of files can be read, write, execute are followed in turn( A )。A. rwx B. xrw C. rdx D. srwAnswer: A2. Exit interactive shell,should input( C )。A. ; B. q C. exit D. quitAnswer: C3.If superuser root

2、 was under the directory:/usr/local,after input cd,the user is under which directory now( B )。A. /home B. /root C. /home/root D. /usr/localAnswer: B4.There is a file named file under the directory:/home/stud1/wang,using( C )can make it run in the background,the command output the content of file to

3、file.copyA. cat file ;file.copy B. cat ;file.copy C. cat file file.copy & D. cat file file.copy &Answer: C5.In UNIX system,the source file changes to executable file through compiling ,the executable file belongs to ( B ) A. ASCII file B. ordinary file C. directory file D. special fileAnswer: B6.The

4、 following narrative on UNIX, which is not correct ( C) A. UNIX file system is a tree structure, easy to manage and retrieve B. UNIX provides a wealth of software tools, such as utilities, text, and development tools C. UNIX manages ordinary files, directories, files, and device files in different w

5、ays D. UNIX is a multi-user, multi-tasking operating systemAnswer: C7.If you want to know the detail usage of find which is a command of Unix, you should input(C) Ahelp find Bfind help Cman find Dfind manAnswer: C8.About the command cp, which is incorrect( C )Acp file1 file2Bcp file1 file2 /tmpCcp r

6、 file1 file2Dcp r /tmp /mytmp Answer: C9.When we create a new file, it has properties as followed( A )AReadable and writable propertyBReadable executable propertyC Writable executable propertyD . Read-write executable propertyAnswer: A10.If we want to change the time of a file,use the command( C )At

7、imeB. Date C. touch D. calAnswer: C11.About the command cd , which is incorrect( D )Acd Back to directory when registering Bcd /tmp into directory /tmpCcd ./ into the upper directoryDcd ./ into the root directoryAnswer: D12.When you create a new directory using the mkdir command, the option when its

8、 parent directories do not exist to create a parent directory is ( D)。A.-mB.-dC.-f D.pAnswer: D13. The following statements, which is not belong to the scope of the role of the ifconfig command ( D ) 。A. Configure the local loopback addressB. Configure the IP address of the network cardC. Activate t

9、he network adapter D. Load the card into the kernel Answer: D14. There are four methods to assignment of variables in the shell,the name of name=12 is ( A )。A. Direct assignment B. Use read command C. Using the command line parameters D. Use the command output 15. Answer: A15.Change the owner of a f

10、ile ,use command ( C )。A. chmod B. touch C. chown D. catAnswer: C16. how many“-”will output in the following procedures?( D)#include #include #include int main() for(int i=0;i2;i+) fork(); printf(-); return 0;A.2 B.4 C.6 D.8Answer: D17. The following description of the error that respect to the i-no

11、de is ( A ).A. i node and file is one to oneB. i node can describe the number of blocks that occupied by the fileC. i-node describes the size of the file and a pointer pointing to the data blocksD. Achieve transformation of the logic and physical structure of the document by the i-nodeAnswer: A18. P

12、ermissions of the outside members of group of a file is read-only; the owner has full permissions; permissions within the group to read and write, then the file permissions is( D )A.467 B.674C.476 D.764Answer: D19. How to display the current directory ( A).A. pwd B. cd B. C. who D. IsAnswer: A20. Wh

13、ich is the return value of the exit command in script, said the script successfully ( D )A、1B、-1C、2 D、0Answer: D21.which command is used of Changing Password( B )A、whoB、passwdC、passwordD、pwdAnswer: B22. Process synchronization refers to the relationship between the process of mutual( B )in logicA、Co

14、nnectionB、restraintC、continueD、CallingAnswer: B24.How set the shell script exam.sh as all users can execute( A )A、chomd a+x exam.shB、chomd a+w exam.shC、chomd a+r exam.shD、chomd u+w exam.shAnswer: A25. Management and control processes by( B )A、Instruction B、PrimitiveC、SemaphoreD、Mail communicationAns

15、wer: B26.Thecommandusedtochangethenameoffileofdirectoryis(C)A、rmB、cpC、mvD、cdAnswer: C27. To compile a C program, enter ( D ) in command prompt.A、c prgnameB、cc o c prgnameC、cccc prgnameD、ccc prgname二判断题(每题2分,共10分)1. ()Like the shell, the output that is generated by print and printf can be directed to

16、 a file or pipe.Answer: True2. ()It is not necessary that the scheduler allocates CPU to the process.Answer: True3. ()When encrypted, the command can specify multiple files as files, and the command encrypted all the files.Answer: False4. ()UDP protocol is a connectionless protocol, so that he can p

17、rovide reliable data transmission.Answer: False5. ()Process is a collection of instructions.Answer: False三填空题(每题2分,共10分)1. The files and directories to package command is _tar_Answer:tar2. The command to end the background process is _kill_Answer:kill3. Use _diff_ command to compare the different be

18、tween two contents of files.Answer:diff4. _stdin_、_stdout_、_stderr_ willbeopenedatthebeginningofthecreationofa LINUX processes.Answer:stdin、stdout、stderr5. List several main directory of UNIX /boot /etc /dev /bin /user /homeAnswer: /boot /etc /dev /bin /user /home6. The Test command can test _file_,

19、 _integer_, _string_.Answer:file、integer、string四简答题(每题8分,共40分)1. In theUNIXoperating systemareclassifiedinthe types ofoperating systems?What are the mainfeatures ofUNIXsystems?Answer: 1 UNIXis amulti-taskingmulti-usertime-sharing system, the requesttimeas the unit torespond to multipleusers. Feature

20、s: Thesimple designand methodsto accomplishmore complex,more comprehensive functionality. Support multi-usermulti-tasking operating environmentfile systemscan easilyhandlingopenness andgoodportability powerful command-featuredsecuritymechanism ofnetwork characteristics.2.Whats the interprocess commu

21、nication? List 3 tools provided by UNIX for interprocess communication.Answer: (1) The interprocess communication is transferring data between different UNIX commands. (2)Three tools: pipeline, command pipeline and socket.3.Describe several operational levels and their corresponding meanings of Linu

22、x.Answer: 0- shutdown mode, 1- single-user mode, only the system administrator can log on single-user mode. 2- multi-user mode, but does not support file sharing, for example, does not support NFS services. This model is not commonly used. 3- complete multi-user mode, support for NFS service. The mo

23、st common user mode, log on to the character-based interface of the system defaultly . 4- retained mode. 5- fully multi-user mode, log on to the X-window system defaultly, which is logged on to the linux graphical interface.6- restart mode, which is executed to close all running processes, then rest

24、art the system. 4. What is the link? What is the difference between symbolic link and hard link ?Answer: Link refers to an i-node corresponds to multiple file names. A hard link is letting the i-node number of the file point to the i-node,and the counter value of the link is incremented 1. When you

25、delete a link of a file, counter value decreased 1.when its value is 0, i node is released.A symbolic link is only a link file,which only has a name,does not point to a real node i. When you delete a symbolic link of a file you can find out that is different from a hard link files.5. The difference

26、between fork and vfork.Answer: 1) fork need copy the data segment of the parent process; While the vfork doesnt need to copy the data segment of parent process completely, the son process and the parent process shared data segment before the son process doesnt call exec and exit.2) fork doesnt make

27、any restrictions to the execution order of the son process and parent process; and in the vford call, the son process first to run, the parent process hang, after the son process calls exec or exit , the execution order of the parent and son process has no longer limit.6. Description the characteris

28、tics of the shell.Answer: Shell is an interactive command interpreter, and is also a kind of programming language. Each statement of it is executable command. Shell to satisfy the interactive command and programming operation command two ways of using requirements, is a kind of special language. Its

29、 application range is wide, and has high operation efficiency.7.What technology does Unix use to read and write pieces of equipment operation?Answer: UNIX block device is realized by using buffer technology to read and write operations. Driver allocate a buffer for write operation, first the informa

30、tion from the user space is copied to the buffer, and output from buffer to the device; To read operation, to receive information from the device to the buffer, then the information is copied to the specified user space. Using buffer technology to reduce number of visits to the piece of equipment ca

31、n improve the throughput of the system.8. If you open a file for read-write with the append flag, can you still read from anywhere in the file using lseek? Can you use lseek to replace existing data in the file?Answer: You can still lseek and read anywhere in the file, but a write automatically rese

32、ts the file offset to the end of file before the data is written. This makes it impossible to write anywhere other than at the end of file.五程序设计题(每题10分,共20分)1. Describes the Unix network programming steps and describes how Unix communications. Answer: Web applications and ordinary program has one of

33、 the biggest difference is that the network application is composed of two parts - the client and server.Network program is the first server startup, waiting for the client program running and establishing the connection. Usually the program in general listening on a port, until there is a client pr

34、ogram sent a request.UNIX system is provided by the socket for network programming. Web application through a socket and a few other function calls, returns a communication file descriptor. We can put this descriptor as a normal file descriptor to operate .This is the UNIX devices independence. We c

35、an do reading and writing operation on the descriptor to achieve network communication.2.Once we have established a connection, the next step is to communicate. We take the channel we setting up before as a file descriptor, so that the server and client could communicate, as long as the file descrip

36、tor, speaking, reading and writing contents. Just like we read and write to the file.2. 程序阅读a.out:#include “apu.h”Int globvar = 6;Char bur = “a write to stdourn”;Int main(void)Intvar;Pid_tpid;Var = 88;If(write(STDOUT_FILENO, buf, sizeof(buf) 1,) != sizeof(buf) 1)Err_sys(“write error”);Printf(“before forkn”);If(pid = fork() &1outfile2. execute with this command and success, write the out put of screen(if there is): $ ./a.out outfile 2&1 $ cat outfileAnswer:1 No2a write to stdout before forkpid = 432, glob = 7, var = 89before forkpid = 431, glob = 6, var =88南开大学UNIX管理与开发期末试卷 9 / 9

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

当前位置:首页 > 项目管理


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