




已阅读5页,还剩137页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
软件工程师培训系列教材UNIX$%!*?|ExceptThedot(.)andunderscore(_),Ch4Metacharacters,Representszeroormorecharacterslsd*,Asterisk(*),Representsanysinglecharacterlsd?lsz?.txt,QuestionMark(?),Matchasetorrangeofcharacterstoasinglecharacterpositionlsb-fb*lsfFf*a?c,SquareBrackets(),Entermultiplecommandsonacommandlinecd;lsdate;cal;pwd,Semicolon(;),Use()toredirecttheoutputofacommandtoafileratherthantothescreenUse()toappendtheoutputofacommandtoanexistingfilecal102004a.txtcal112004a.txtcatf2.txt,AngleBrackets(,),Takestheoutputofonecommandandpassesitasinputintoafollowingcommandcal72003|lpls-l/etc|more,Piping(|),Configurationfiles,webpages,programsourcecodearealltext-basedTextviewersv.s.editors,Ch5TextEditing,DisplaysthecontentsofatextfileonscreenIsoftenusedtojointwoormorefilesintoonelargefilecatfilename(s)cat/dev/null/b.txtcat/etc/passwd|awk-F:print$1“t”$6|sort/userinfo,cat,Displaysthecontentsofatextfileonescreenatatimemorefilename(s)SpacebarScrolltothenextscreenReturnScrollonelineatatimebMovebackonescreenfMoveforwardonescreenhDisplayaHelpmenuofmorefeaturesqQuitandreturntotheshellprompt/stringSearchforwardforstringnFindnextoccurrenceofstring,more,DisplaysthefirstorlastnlinesofoneormorefilesDisplaysfirstorlast10linesbydefaulthead-nfilename(s)tail-nfilename(s)tail-30/usr/dict/words,headfind/export/home/html-name*.html-print|xargsperl-p-i.bak-e“s/Copyright2004/Copyright2005/g;”,find,Searchesafileforaspecifiedtextstringandprintsalllinesthatcontainthatpatterntothescreencasesensitivegrepoption(s)stringfilename-iIgnorecaseofstringwhensearching-vSearchforalllinesthatdonotmatchstringgreproot/etc/passwdls-la|grep-isep1,grep,Displaysaline,word,orcharactercountofafilewcoptionsfilename(s)-lCountslines-wCountswords-CCountscharactersgrepwang/etc/passwd|wc-l,wc,Findsdifferencesbetweentextfilesdiffoptionfile1file2,diff,Summarizediskusagedusk*,du,listtheprocessescurrentlyrunningonthesystem/usr/bin/ps-options-eListeveryprocessnowrunning-fGeneratesafulllisting-uuidlistProcesseswhoserealUIDorloginnamesaregivenpsef|greptelnet/usr/ucb/ps-auwxprstat,ps,Terminateunwantedcommandprocessesthatyoucannotquitinthenormalwaykill-signalprocess-idkill12932kill-912418sleep1001ls%aliaslsls-l%aliascopycp-i%alias%unaliascopy,Aliases,Csh:setprompt=valuesetprompt=hostname:$cwd%“Bash:PS1=hostname$exportPS1,CustomPrompts,#Starting.cshrcumask022setenvCC/usr/local/bin/gccsetenvCCC/usr/local/bin/g+setenvORACLE_BASE/tarenaorasetenvORACLE_HOME$ORACLE_BASE/software/9.0.1setenvORACLE_SIDTARENADBsetenvJAVA_HOME/usr/j2sesetenvMANPATH/usr/share/man:/usr/man:/usr/share/catman:/usr/catmansetenvLD_LIBRARY_PATH/usr/lib:/usr/dt/lib:$ORACLE_HOME/libsetenvEDITORvisetpath=(/usr/j2se/bin/usr/bin/usr/local/bin/usr/ucb/usr/ccs/bin/etc.)sethistory=100setprompt=hostname!%aliasllls-l|morealiasmake/usr/bin/make,An.cshrcExample,CONFIDENTIAL,SetupUnixEnvironmentforC/C+Programming,中国北京:电话:62136369,62196102地址:海淀区北三环西路18号中鼎大厦B座701、709Email:tarena加拿大多伦多:Tel.:1-(647)284-8872Add.:106-7CrescentPlaceToronto,OntarioM4C5L7,Canada,SettingupenvironmentvariablesforC/C+programmingUsingC/C+compilerstogenerateobjectfilesandexecutablesBeingfamiliarwithC/C+compilercommonoptionsWritingyourownmakefilesGettingonlinehelp,Goals,CCspecifiesCcompilerCCCspecifiesC+compilerPATHspecifiespathtolocateexecutablesLD_LIBRARY_PATHspecifiesdirectoriesfromwhichthelinkerlooksforsharedlibraries,EnvironmentVariablesforC/C+Programming,Settingupenvironmentvariablesin.cshrcinuserhomedirectoryAsample.cshrcfile,SettingupEnvironmentVariablesforcsh,SfileinuserhomedirectoryAfilefile,SettingupEnvironmentVariablesforOtherShells,File:Hello.c,#includevoidmain(void)printf(“HelloTarena!n”);%gcchello.c%a.outHelloTarena!%,TheFirstCProgram,CComplierscc/gccC+Compliersg+GNUmake,UnixC/C+ProgrammingEnvironment,gccofile.c,#includevoidmain(void)printf(“HelloTarena!n”);%gccohellohello.c%helloHelloTarena!%,CompilerOptionsGeneratingSpecifiedFiles,gcc-w,#includevoidmain(void)printf(“HelloTarena!n”);%gccohellohello.chello.c:4:warning:returntypeofmainisnotint%gccwohellohello.c,CompilerOptionsGivingoutWarningInfoDuringCompiling,gccL-l,#include#includeintmain(void)printf(“HelloTarena!n”);%gccwohellohello.clsocket-lnsl,CompilerOptionsSpecifyingSharedLibrariesandTheirPaths,gcc-I,#includeintmain(void)printf(“HelloTarena!n”);%gccwI./ohellohello.c,CompilerOptionsSpecifyingIncludePaths,gccg,#includeintmain(void)printf(“HelloTarena!n”);%gccwgcohello.ohello.c%gccohellohello.o,CompilerOptionsGeneratingDebug,InformationinObjectFiles,makeTheoutputfilehasthesameprefixasthesourcefileEnvironmentvariablesCCandCCCspecifyCandC+compilersrespectively,#includevoidmain(void)printf(“HelloTarena!n”);%makehello/usr/local/bin/gccohellohello.c,UsingMaketoGenerateASimpleExecutable,Makefilename:makefileorMakefileDefiningdependenciesElementsinmakefileMacros:Syntax:VARIABLE=VALUESample:CC=/usr/local/bin/gccDependencies:Syntax:target:dependenciescommandsSample:hello:hello.o$(CC)ohellohello.o$(LIBS),ProjectMakeFile,CCC=/usr/local/bin/g+CPPFLAGS=-gLIBS=-lsocket-lnslEXEC=testCreateOBJS=testCreate.ocreate.oall:$(EXEC)clean:rm$(OBJS)$(EXEC):$(OBJS)$(CCC)-o$(EXEC)$(OBJS)$(LIBS)create.o:create.cc$(CCC)$(CPPFLAGS)-c-ocreate.ocreate.cctestCreate.o:testCreate.cc$(CCC)$(CPPFLAGS)-ctestCreate.cc-otestCreate.o,ASampleMakeFile,Syntax:maketargetSample:makemakeclean,UsingMakeFile,Fromonlinemanual,weknowHeaderfilesshouldbeincludedLibrariesshouldbeusedThesignatureofafunctionOtherrelatedinformationForexample:%mansocket,ccflag.file.-lsocket-lnsllibrary.#include#includeintsocket(intdomain,inttype,intprotocol);SEEALSOnca(1),close(2),fcntl(2),ioctl(2),read(2),write(2),accept(3SOCKET),bind(3SOCKET),connect(3SOCKET),getsockname(3SOCKET),getsockopt(3SOCKET),listen(3SOCKET),recv(3SOCKET),setsockopt(3SOCKET),send(3SOCKET),shutdown(3SOCKET),socketpair(3SOCKET),attributes(5),in(3HEAD),socket(3HEAD),GettingUnixOnlineHelp,CONFIDENTIAL,TarenaHigh-EndITTraining,ConcurrentVersionSystem,中国北京:电话62136369地址:海淀区北三环西路18号中鼎大厦B座701、709室邮编:100086Email:beijing中国上海:电话61202603地址:上海市北京东路668号(上海科技京城)C区9楼邮编:200001Email:shanghai加拿大多伦多:Tel:1-(647)284-8872Address:106-7CrescentPlaceToronto,Ontario,CanadaPostCode:M4C5L7,CVSinstallationThefunctionsofCVSThestructureofCVSHowtouseCVSTherelatedtechnologies,Goals,http:/www.loria.fr/molli/cvs-index.htmlJCVSusenetgroupcomp.software.config-mgmt,CVSResources,DownloadCVSbinaryversionfrominternet,inabrowsertypeftp:/,CVSSampleInstallation,Createadirectoryandmakeitaccessibleforuserswhowanttouseit#mkdir/users/cvs#chmod777/users/cvsInitialCVSrepository#cvsd/users/cvsinitLoginascommonuserandsetCVSenironmentAddsetenvCVSROOT/users/cvsto.cshrcforcshelluserAddCVSROOT=/users/cvs;exportCVSROOTfileforothershelluser,CVSLocalConfiguration,1.Becomesuperuser2.Addlinecvspserver2401/tcpto/etc/services3.Addlinecvspserverstreamtcpnowaitroot/export/home/openlab/cvs/bin/cvscvs-f-allow-root=/export/home/openlab/cvspserverto/etc/inetd.conf4.SendsignalSIGHUPtosuperdaemoninetd#pkillHUPinetd5.Creategroupcvsandusercvs6.BecomeusercvsandinitialCVSrepository%setenvCVSROOT=:pserver:cvsopenlab.ca:/export/home/openlab/cvs%cvsinit,CVSNetworkSampleServerConfiguration,7.Make$CVSROOTaccessibletousers%chmod777/export/home/openlab/cvs8.Addusersto$CVSROOT/CVSROOT/writersand$CVSROOT/CVSROOT/passwd,CVSNetworkSampleServerConfiguration(cont.),CVSROOTtellingCVSwheretherepositoryiscsh:setenvCVSROOTrepository_direxample:setenvCVSROOT:pserver:gzhuopenlab:/export/home/openlab/cvsothershells:CVSROOT=repository_dir;exportCVSROOTexample:CVSROOT=:pserver:gzhuopenlab:/export/home/openlab/cvs;exportCVSROOTCVSEDITORtellingwhateditorusedtoeditcommentscsh:setenvCVSEDITOR/usr/bin/viothershells:CVSEDITOR=/usr/bin/vi;exportCVSEDITORPATHtellingfromwhichdirectoryyoucanfindcommandsforCVSCSH:setenvPATH/export/home/openlab/cvs/bin:$PATHOtherShells:PATH=/export/home/openlab/cvs/bin:$PAHT;exportPATHMANPATHtellingthelocationofonlinemanualforCVScsh:setenvMANPATH/export/home/openlab/cvs/man:$MANPATHOthershells:MANPATH=/export/home/openlab/cvs/man:$MANPATH;exportMANPATH,CVSClientEnvironmentVariables,.cshrc,TheSampleCShellScript,.profile,TheSampleBShellScript,ConcurrentVersionControlSystemMulti-versionMulti-programmerSourceCodeBackupSystembackupModificationrecord,CVSfunctions,CVSClient,CVSServer,FileServer,File,CVSStructure,$CVSROOT-yoyodyne-tc-Makefile,v-backend.c,v-driver.c.v-frontend.c,v-parser.c,v-man-tc.1,v-testing-testpgm.t,v-test2.t,v,TheRepositoryHierarchy,1.LogontoCVS%cvslogin2.Setupanewproject1.makeadirectory%mkdirnnm%cdnnm2.maketheprojectdirinyourhome%cvsimportm“networknodemanagement”nnmv_0_0_1start%cd.%cvscheckoutnnm/*onlyfirsttime*/,BuildingYourCVSSystem,Addinganewfile%cvsaddfile.cMakingchangespermanent%cvscommitfile.c,MakingChangesinTheCVSRepository,Checkingthestatusofallfiles%cvsstatusCheckingthestatusofafile%cvsstastusfile.cFile:file.cStatus:Up-to-dateWorkingrevision:Repositoryrevision:1.2/home/cvsroot/cvstest/file.c,vStickyTag:(none)StickyDate:(none)StickyOptions:(none)FourpossiblestatusUp-to-date:thelatestversionLocallyModified:modifiedwithoutcommitNeedingPa
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 河南地矿职业学院《食品机械与设备实验》2024-2025学年第一学期期末试卷
- 德阳城市轨道交通职业学院《体育测量学》2024-2025学年第一学期期末试卷
- 浙江越秀外国语学院《艺术设计基础》2024-2025学年第一学期期末试卷
- 西南交通大学《剪辑包装设计与制作》2024-2025学年第一学期期末试卷
- 工业厂房安全管理合同范本
- 滁州城市职业学院《图形界面设计》2024-2025学年第一学期期末试卷
- 郑州亚欧交通职业学院《幼儿心理与行为指导》2024-2025学年第一学期期末试卷
- 郑州升达经贸管理学院《数字媒体专业英语》2024-2025学年第一学期期末试卷
- 广东省外语艺术职业学院《地域建筑创新设计》2024-2025学年第一学期期末试卷
- 南京邮电大学《体育人力资源管理》2024-2025学年第一学期期末试卷
- 秋季肌肤护理课件
- 泪腺肿瘤护理课件
- 中建幕墙安装工安全培训课件
- 高端住宅保洁服务策划方案
- 大单元教学培训
- 公墓建设可行性研究报告
- 混合痔护理教学课件
- 矿井物探工作管理制度
- 中建五局公司管理制度
- 2025-2030年中国膀胱过度活动疗法行业市场现状供需分析及投资评估规划分析研究报告
- 石家庄供暖管网规划方案
评论
0/150
提交评论