首页 UNIX管理与开发期末考试试卷(英文版)

UNIX管理与开发期末考试试卷(英文版)

举报
开通vip

UNIX管理与开发期末考试试卷(英文版)南开大学UNIX管理与开发期末试卷PAGE9/NUMPAGES9南开大学2013——2014年度第二学期《Unix管理与开发》期末考试试卷(考试时间:100分钟总分100分)院(系)软件工程学号姓名分数一.选择正确的答案(每题2分,共20分)1.Thesignsoffilescanberead,write,executearefollowedinturn(A)。A.rwxB.xrwC.rdxD.srwAnswer:A2.Exitinteractiveshell,shouldinput(C)。A.;B.^...

UNIX管理与开发期末考试试卷(英文版)
南开大学UNIX管理与开发期末试卷PAGE9/NUMPAGES9南开大学2013——2014年度第二学期《Unix管理与开发》期末考试试卷(考试时间:100分钟总分100分)院(系)软件 工程 路基工程安全技术交底工程项目施工成本控制工程量增项单年度零星工程技术标正投影法基本原理 学号姓名分数一.选择正确的答案(每题2分,共20分)1.Thesignsoffilescanberead,write,executearefollowedinturn(A)。A.rwxB.xrwC.rdxD.srwAnswer:A2.Exitinteractiveshell,shouldinput(C)。A.;B.^qC.exitD.quitAnswer:C3.Ifsuperuserrootwasunderthedirectory:/usr/local,afterinputcd,theuserisunderwhichdirectorynow(B)。A./homeB./rootC./home/rootD./usr/localAnswer:B4.Thereisafilenamedfileunderthedirectory:/home/stud1/wang,using(C)canmakeitruninthebackground,thecommandoutputthecontentoffiletofile.copyA.catfile>;file.copyB.cat>;file.copyC.catfilefile.copy&D.catfile>file.copy&Answer:C5.InUNIXsystem,thesourcefilechangestoexecutablefilethroughcompiling,theexecutablefilebelongsto(B)A.ASCIIfileB.ordinaryfileC.directoryfileD.specialfileAnswer:B6.ThefollowingnarrativeonUNIX,whichisnotcorrect(C)A.UNIXfilesystemisatreestructure,easytomanageandretrieveB.UNIXprovidesawealthofsoftwaretools,suchasutilities,text,anddevelopmenttoolsC.UNIXmanagesordinaryfiles,directories,files,anddevicefilesindifferentwaysD.UNIXisamulti-user,multi-taskingoperatingsystemAnswer:C7.IfyouwanttoknowthedetailusageoffindwhichisacommandofUnix,youshouldinput(C)A.helpfindB.findhelpC.manfindD.findmanAnswer:C8.Aboutthecommandcp,whichisincorrect(C)A.cpfile1file2B.cpfile1file2/tmpC.cp–rfile1file2D.cp–r/tmp/mytmpAnswer:C9.Whenwecreateanewfile,ithaspropertiesasfollowed(A)A.ReadableandwritablepropertyB.ReadableexecutablepropertyC.WritableexecutablepropertyD.Read-writeexecutablepropertyAnswer:A10.Ifwewanttochangethetimeofafile,usethecommand(C)A.timeB.DateC.touchD.calAnswer:C11.Aboutthecommandcd,whichisincorrect(D)A.cdBacktodirectorywhenregisteringB.cd/tmpintodirectory/tmpC.cd../intotheupperdirectoryD.cd./intotherootdirectoryAnswer:D12.Whenyoucreateanewdirectoryusingthemkdircommand,theoptionwhenitsparentdirectoriesdonotexisttocreateaparentdirectoryis(D)。 A. -m           B. -d         C. -f       D. –pAnswer:DThefollowingstatements,whichisnotbelongtothescopeoftheroleoftheifconfigcommand(D)。A.ConfigurethelocalloopbackaddressB.ConfiguretheIPaddressofthenetworkcardC.ActivatethenetworkadapterD.LoadthecardintothekernelAnswer:DTherearefourmethodstoassignmentofvariablesintheshell,thenameofname=12is(A)。A.DirectassignmentB.UsereadcommandC.UsingthecommandlineparametersD.UsethecommandoutputAnswer:A15.Changetheownerofafile,usecommand(C)。A.chmodB.touchC.chownD.catAnswer:Chowmany“-”willoutputinthefollowingprocedures?(D)#include#include#includeintmain(){for(inti=0;i<2;i++){fork();printf("-");}return0;}A.2B.4C.6D.8Answer:D17.Thefollowingdescriptionoftheerrorthatrespecttothei-nodeis(A).A.inodeandfileisonetooneB.inodecandescribethenumberofblocksthatoccupiedbythefileC.i-nodedescribesthesizeofthefileandapointerpointingtothedatablocksD.Achievetransformationofthelogicandphysicalstructureofthedocumentbythei-nodeAnswer:A18.Permissionsoftheoutsidemembersofgroupofafileisread-only;theownerhasfullpermissions;permissionswithinthegrouptoreadandwrite,thenthefilepermissionsis(D)A. 467         B. 674        C. 476       D. 764 Answer:D19.Howtodisplaythecurrentdirectory(A).pwdB.cdC.whoD.IsAnswer:A20.Whichisthereturnvalueoftheexitcommandinscript,saidthescriptsuccessfully(D)A、1B、-1C、2D、0Answer:D21.whichcommandisusedofChangingPassword(B)A、whoB、passwdC、passwordD、pwdAnswer:B22.Processsynchronizationreferstotherelationshipbetweentheprocessofmutual(B)inlogicA、ConnectionB、restraintC、continueD、CallingAnswer:B24.Howsettheshellscriptexam.shasalluserscanexecute(A)A、chomda+xexam.shB、chomda+wexam.shC、chomda+rexam.shD、chomdu+wexam.shAnswer:A25.Managementandcontrolprocessesby(B)A、InstructionB、PrimitiveC、SemaphoreD、MailcommunicationAnswer:B26.The command used to change the name of file of directory is(C)A、rmB、cpC、mvD、cdAnswer:C27.TocompileaCprogram,enter(D)incommandprompt.A、cprgnameB、cc–ocprgnameC、ccccprgnameD、cccprgname二.判断题(每题2分,共10分)(√)Liketheshell,theoutputthatisgeneratedbyprintandprintfcanbedirectedtoafileorpipe.Answer:True(√)ItisnotnecessarythattheschedulerallocatesCPUtotheprocess.Answer:True(×)Whenencrypted,thecommandcanspecifymultiplefilesasfiles,andthecommandencryptedallthefiles.Answer:False(×)UDPprotocolisaconnectionlessprotocol,sothathecanprovidereliabledatatransmission.Answer:False(×)Processisacollectionofinstructions.Answer:False三.填空题(每题2分,共10分)1.Thefilesanddirectoriestopackagecommandis____tar___Answer:tar2.Thecommandtoendthebackgroundprocessis__kill__Answer:killUse__diff__commandtocomparethedifferentbetweentwocontentsoffiles.Answer:diff__stdin__、__stdout__、_stderr__will be opened at the beginning of the creation of aLINUXprocesses.Answer:stdin、stdout、stderrListseveralmaindirectoryofUNIX/boot/etc/dev/bin/user/homeAnswer:/boot/etc/dev/bin/user/home6.TheTestcommandcantest__file__,__integer__,__string__.Answer:file、integer、string四.简答题(每题8分,共40分)Inthe UNIX operatingsystem are classified in thetypesof operatingsystems? Whatarethemain featuresofUNIX systems?Answer:1.UNIX isa multi-tasking multi-user time-sharingsystem,therequest time astheunitto respondtomultipleusers.Features:The simpledesign andmethods toaccomplish morecomplex, morecomprehensivefunctionality.Supportmulti-user multi-taskingoperatingenvironment filesystems caneasily handling opennessand goodportabilitypowerfulcommand-featured security mechanismof networkcharacteristics.2.What'stheinterprocesscommunication?List3toolsprovidedbyUNIXforinterprocesscommunication.Answer:(1)TheinterprocesscommunicationistransferringdatabetweendifferentUNIXcommands.(2)Threetools:pipeline,commandpipelineandsocket.3.DescribeseveraloperationallevelsandtheircorrespondingmeaningsofLinux.Answer: 0-shutdownmode,   1-single-usermode,onlythesystemadministratorcanlogonsingle-usermode.   2-multi-usermode,butdoesnotsupportfilesharing,forexample,doesnotsupportNFSservices.Thismodelisnotcommonlyused.   3-completemulti-usermode,supportforNFSservice.Themostcommonusermode,logontothecharacter-basedinterfaceofthesystemdefaultly.   4-retainedmode.   5-fullymulti-usermode,logontotheX-windowsystemdefaultly,whichisloggedontothelinuxgraphicalinterface.6-restartmode,whichisexecutedtocloseallrunningprocesses,thenrestartthesystem.4.Whatisthelink?Whatisthedifferencebetweensymboliclinkandhardlink?Answer:Linkreferstoani-nodecorrespondstomultiplefilenames.Ahardlinkislettingthei-nodenumberofthefilepointtothei-node,andthecountervalueofthelinkisincremented1.Whenyoudeletealinkofafile,countervaluedecreased1.whenitsvalueis0,inodeisreleased.Asymboliclinkisonlyalinkfile,whichonlyhasaname,doesnotpointtoarealnodei.Whenyoudeleteasymboliclinkofafileyoucanfindoutthatisdifferentfromahardlinkfiles.5.Thedifferencebetweenforkandvfork.Answer:1)forkneedcopythedatasegmentoftheparentprocess;Whilethevforkdoesn’tneedtocopythedatasegmentofparentprocesscompletely,thesonprocessandtheparentprocessshareddatasegmentbeforethesonprocessdoesn’tcallexecandexit.2)forkdoesn’tmakeanyrestrictionstotheexecutionorderofthesonprocessandparentprocess;andinthevfordcall,thesonprocessfirsttorun,theparentprocesshang,afterthesonprocesscallsexecorexit,theexecutionorderoftheparentandsonprocesshasnolongerlimit.6.Descriptionthecharacteristicsoftheshell.Answer:Shellisaninteractivecommandinterpreter,andisalsoakindofprogramminglanguage.Eachstatementofitisexecutablecommand.Shelltosatisfytheinteractivecommandandprogrammingoperationcommandtwowaysofusingrequirements,isakindofspeciallanguage.Itsapplicationrangeiswide,andhashighoperationefficiency.7.WhattechnologydoesUnixusetoreadandwritepiecesofequipmentoperation?Answer:UNIXblockdeviceisrealizedbyusingbuffertechnologytoreadandwriteoperations.Driverallocateabufferforwriteoperation,firsttheinformationfromtheuserspaceiscopiedtothebuffer,andoutputfrombuffertothedevice;Toreadoperation,toreceiveinformationfromthedevicetothebuffer,thentheinformationiscopiedtothespecifieduserspace.Usingbuffertechnologytoreducenumberofvisitstothepieceofequipmentcanimprovethethroughputofthesystem.8.Ifyouopenafileforread-writewiththeappendflag,canyoustillreadfromanywhereinthefileusinglseek?Canyouuselseektoreplaceexistingdatainthefile?Answer:Youcanstilllseekandreadanywhereinthefile,butawriteautomaticallyresetsthefileoffsettotheendoffilebeforethedataiswritten.Thismakesitimpossibletowriteanywhereotherthanattheendoffile.五.程序设计题(每题10分,共20分)1.DescribestheUnixnetworkprogrammingstepsanddescribeshowUnixcommunications.Answer:Webapplicationsandordinaryprogramhasoneofthebiggestdifferenceisthatthenetworkapplicationiscomposedoftwoparts-theclientandserver.Networkprogramisthefirstserverstartup,waitingfortheclientprogramrunningandestablishingtheconnection.Usuallytheprogramingenerallisteningonaport,untilthereisaclientprogramsentarequest.UNIXsystemisprovidedbythesocketfornetworkprogramming.Webapplicationthroughasocketandafewotherfunctioncalls,returnsacommunicationfiledescriptor.Wecanputthisdescriptorasanormalfiledescriptortooperate.ThisistheUNIXdevice’sindependence.Wecandoreadingandwritingoperationonthedescriptortoachievenetworkcommunication.2.Oncewehaveestablishedaconnection,thenextstepistocommunicate.Wetakethechannelwesettingupbeforeasafiledescriptor,sothattheserverandclientcouldcommunicate,aslongasthefiledescriptor,speaking,readingandwritingcontents.Justlikewereadandwritetothefile.2.程序阅读a.out:#include“apu.h”Intglobvar=6;Charbur[]=“awritetostdour\n”;Intmain(void){Intvar;Pid_tpid;Var=88;If(write(STDOUT_FILENO,buf,sizeof(buf)–1,)!=sizeof(buf)–1)Err_sys(“writeerror”);Printf(“beforefork\n”);If((pid=fork())<0){Err_sys(“forkerror”);}elseif(pid=0){Globvar++;Var++;}else{Sleep(2);}Printf(“pid=%ld,glob=%d,var=%d\n”,(long)getpid(),globvar,var);Exit(0);}executewiththiscommandandoccouranerror,willtherebeerroroutput?:$./a.out2>&1>outfileexecutewiththiscommandandsuccess,writetheoutputofscreen(ifthereis):$./a.out>outfile2>&1$catoutfileAnswer:No2awritetostdoutbeforeforkpid=432,glob=7,var=89beforeforkpid=431,glob=6,var=88
本文档为【UNIX管理与开发期末考试试卷(英文版)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
个人认证用户
中小学教育资料
暂无简介~
格式:doc
大小:96KB
软件:Word
页数:17
分类:企业经营
上传时间:2022-11-13
浏览量:3