欢迎来到天天文库
浏览记录
ID:18952000
大小:171.00 KB
页数:11页
时间:2018-09-27
《网络编程技术实验指导书》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、网络编程技术-实验指导书 董黎刚信息与电子工程学院浙江工商大学2006/10/314:29:00Content1.OperationofLinux(操作性)11.1Purpose11.2Content11.3Hints22.CProgrammingPractice(设计性)32.1Purpose32.2Content32.3Grading33.SimpleSocketProgramming(验证性)43.1Purpose43.2Content43.3Hints44.ConcurrencySocketProgramming(验
2、证性)54.1Purpose54.2Content54.3Hints55.WindowsSocketProgramming(验证性)65.1Purpose65.2Content65.3Hints66.AdvancedSocketProgramming(设计性)76.1Purpose76.2Content76.3Grading8ExperimentsofNetworkProgrammingLastupdated:2021/6/251.OperationofLinux(操作性)Name:No.:Class:Grading:1.1Purp
3、oseReviewtheoperationofLinux,inparticularshellcommands(bash).1.2ContentEachstudentisrequiredtofinishallofthefollowingtasks.PartIProgramming1)Use“vi”toconstructaprogram“helloworld.c”thatcanprint“helloworld”.Compileandrunit.(hint:gcchelloworld.c,./a.out)PartIIFile/Direct
4、ory2)Makeanewsub-directoryincurrentdirectory,thenmove“helloworld.c”intothisnewsub-directory.(hint:mkdirsource,mvold_filenew_file)3)Changetheaccesspermissionsof“helloworld.c”to-rw-r-xrw-.(hint:chmod656helloworld.c)4)Findafilenamed“emacs”inharddisk.(hint:find/-nameemacs)
5、5)Makeahardlink,whichiscalled“helloworld1.c”,of“helloworld.c”.(hint:lnold_filenew_file);6)Makeasymboliclink,whichiscalled“helloworld2.c”,of“helloworld1.c”.Thenremovehelloworld1.c.(hint:ln–sold_filenew_file)Checktheoutputof“ls–l”tocomparethehardlinkandsoftlink.7)Makeaco
6、pyof“helloworld.c”.Thenewfileis“helloworld3.c”.(hint:cpsource_filedestination_file)8)Archiveandcompressallthefilesinsideasub-directory.(hint:tarcvfnew_file.tar *,gzipold_file)PartIIIText9)Showthefirst10lineofhelloworld.cinreverseorder.(hint:headhelloworld.c
7、sort-r)10)P
8、rintthenumberofbytes,words,andlinesofhelloworld.ctoafilecalled“info.txt”.(hint:wchelloworld.c>info.txt)11)Mergehelloworld.candinfo.txttoanewfile“helloworld.txt”.(hint:pastehelloworld.cinfo.txt>helloworld.txt)12)Printcolumn3-5of“helloworld.c”.(hint:cut–c3-5helloworld.c)
9、13)Remove“/home/your_name/source”.(hint:rmdir,rm)PartIVProcess14)comparethedifferenceamong“ps”,“ps–f”,and“ps–ef”.15)e
此文档下载收益归作者所有