linux命令.ppt_第1页
linux命令.ppt_第2页
linux命令.ppt_第3页
linux命令.ppt_第4页
linux命令.ppt_第5页
已阅读5页,还剩56页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

UNIX操作系统 第五版 JerryPeek GraceTodino JohnStrang著龚志翔等译2003年1月出版书号 7 111 10164 2页数 188定价 26 00元 ReferenceBook LoginandoutofaSolarissystemNavigatetheSolarisfilesystemCreatefilesanddirectories andchangetheirpermissionsManipulatetextfiles andusethevitexteditorUsecommandstosearchdirectoriesandfilesUsebasicnetworkcommandsIdentifyandmodifyinitializationfiles CourseObjectives TrainingEnvironment SUNUltra10WorkstationwithSolarisOperatingSystemExpectingdays 2 5days EnvironmentandDuration Ch1SolarisComputingEnvironment ReleasesunOSSolarisHP UXAIXWindowsRedhatLinuxDateversionversionversionversionversionversion Halloween UnixVersionHistory Whatcanitdo Server Webserver Mailserver DatabaseServer ProgramDevelopmentWhoshouldknowUnix Unixadministrator OracleAdministrator NetworkEngineerProgramDeveloper MoreaboutUnix Inputdevices Outputdevices RAM CPU I O Harddisk Hardware OperatingSystemvs ApplicationSoftwareClientvs Server Software SolarisOS KernelShellFileSystem Hardware Kernel Shell CPU Managesdevices memory andprocessesControlsthefunctionsbetweenthesystemprograms utilitiesandthesystemhardwareManagesswapspace daemons filesystems andotherfunctions Kernel Ashellisaninterfacebetweentheuserandthekernel whichactsasaninterpreterortranslatorShellsareavailableintheSolarisenvironment Bourneshell sh Kornshell ksh Cshell csh Bourne againshell bash Shell WrittenbyStephenBourneforAT TUnixTheearliestandbest knownUnixshellCommondenominatorofmostshellscriptingBourne AgainShell bash root user BourneShell sh CreatedaspartofBSDUnixbyBillJoy theauthorofvi attheUniversityofCaliforniaatBerkeleyIntroducedcommand linehistoryandaprogrammingenvironmentsimilartotheCprogramminglanguageNotcompatiblewithBourneshellsyntaxtcsh anenhancedbuttotallycompatiblecsh root user CShell csh Ahierarchyofdirectories subdirectories andfilesgroupedtogetherforaspecificpurpose Directory Alocationforotherfilesanddirectories Thedirectorystructureenablesyoutocreatefilesanddirectoriesaccessedthroughahierarchyofdirectories Subdirectory Anydirectorybelowanotherdirectory Forexample someofthesubdirectoriesunderthe directoryare usr etc and kernel TheFileSystem ApathnameuniquelyidentifiesaparticularfileordirectorybyspecifyingitslocationAslash betweeneachdirectorynameinthepathtoindicatedifferentdirectoriesAslashinthefirstpositionrepresentsthe directoryAbsolutePathnameSpecifiesafileordirectoryinrelationtothe directoryBeginwithaslashRelativePathnameSpecifiesafileinrelationtothecurrentworkingdirectoryDonotbeginwithaslash Pathnames The root filesystem On dev dsk c0t0d0s0 opt etc dev usr kernel var export default dsk adm home bin share lib On dev dsk c0t0d0s6 The usrfilesystem Application1 Application2 user1 user2 user3 On dev dsk c0t0d0s5 The optfilesystem The export homefilesystem On dev dsk c0t0d0s7 Command option s argument s AspacemustbeusedasadelimiterbetweeneachpartofthecommandlineUpto256characterscanbeenteredonasinglecommandlineDifferentfromDOSCasesensitiveDifferentcommandprompt Command LineSyntax Ch2Login Logout Logintelnet192 168 0 23login username password user spassword Logoutexitorlogout Ctrl D MustbesixtoeightcharactersinlengthShouldcontainatleasttwoalphabeticcharactersandonenumericorspecialcharacterMustdifferfromtheloginIDMustdifferfromthepreviouspasswordbyatleastthreecharacters PasswordRequirements ChangingpasswordsfrequentlyhelpsavoidunauthorizedaccessTypethepasswdcommandTypeyourcurrentpasswordandpressReturnTypeyournewpasswordandpressReturnRetypethenewpasswordandpressReturn ChangingYourPassword etc passwdroot x 0 1 SuperUser bin sh etc shadowroot daGaerRdafGEg Usernamevs UIDUser shomedirectory UserAccounts Ch3BasicUnixCommands Cleartheterminalscreenclear clear Displaytheabsolutepathnameofthecurrentdirectory printworkingdirectory pwd pwd ChangeDirectoriesAcceptbothabsoluteandrelativepathnamesCurrentdirectory Parentdirectory cd directory name cd export home jerrycdjerry dir1cdcd cd DisplayingaListingofFilesandDirectoriesls aDisplayinghiddenfilesHiddenfile afilestartedwitha ls RDisplayingarecursivelistingls tSortsbytimestampinsteadofbynamels lDisplayingalonglistdrwxr xr x4usernobody1024Feb2209 20a txt文拥同其链拥拥大最后一次文件有组它接有有小修改时间件类者人人号者组名型权权权限限限 ls ddirectory normalfilefilefilename s Text includingASCIItext Englishtext commandstextandexecutablescriptsExecutableorBinary including32 bitexecutableandextensiblelinkingformat ELF codefilesandotherdynamicallylinkedexecutablesData thosecreatedbyanapplicationrunningonthesystemls FDisplayingfiletypes目录文件 可执行文件 文本文件 none FileType r 读权限w 写权限 对目录来说 可生成文件与子目录或删除文件与子目录x 执行权限 对目录来说 可查找该目录下内容 没有权限如 rw r r 拥同其有组它者人人其中拥有者 生成文件时登录的人 权限最高 u表示同组人 系统管理员分配的同组的一个或几个人 g表示其它人 除拥有者 同组人外的人 o表示所有人 包括拥有者 同组人及其它人 a表示 FilePermission ChangepermissionsSymbolicmodeusescombinationsoflettersandsymbolschmodg rfile1chmodu x go rfile1chmoda rwfile1 chmod chmodmodefilename whocppermission s rReadwWritexExecute Setpermissions Removeaccess Giveaccess uUserorownerofthefilegGrouptowhichthefilebelongsoOthersoutsideownerandgroupaAlloftheabove Octalmodeusesoctalnumberschmod555dantechmod644dantechmod755dante OctalValuePermissions 4Read 2Write 1Execute OctalValuePermissions 7rwx 6rw 5r x 4r 3 wx 2 w 1 x 0 Createnew emptyfilesorupdateaccessandmodificationtimestouchfilename s touch CreatedirectoriesusingeitheranabsoluteorarelativepathnameMusthavetheappropriatepermissionstocreateadirectorymkdir p directory namemkdirdir1 dir2mkdirdir3dir4dir5mkdir gamesmkdir pdir6 dir7 dir8 mkdir Copyfilescp i source filedestination filecp i source file s destination directorycpbeansapplecpbeansappledir2cp ibeansappleCopyadirectoryanditscontentstoanotherdirectorycp r i source directory s destination directorycp rdir3dir4cp rdir3dir4 tmp cp Moveorrenamefilesanddirectoriesmv i sourcetarget filemv i sourcetarget directorymvnutsbeansmv export home jerry brands mvdir5dir6 mv Removefilesrm i filename s rmfile1file2file3rm ifile4RemovingDirectoriesrmdirdirectory name s rm r i directory name s rmdirempty dirrm rdir6rm ir dir7 rm rmdir CreatealternatenamesoraliasesforfilesanddirectoriesTwokindsoflinks hardandsymbolic orsoft ln s source filetarget file ln Symboliclinkslinkafileordirectoryacrossfilesystems HardlinksUsedtolinkfilesonthesamefilesystemFilesthatarehardlinkedsharethesameinodenumberandrefertothesamedataontheharddisk TheUNIXManpagesdescribesinformationaboutthesystem son linecommands systemcalls fileformats andsystemmaintenancemannameman kkeywordScrollinginManpagesSpacebarScrollthroughamanualpageonescreenatatimeReturnScrollthroughamanualpageonelineatatimebMovebackonescreenfMoveforwardonescreenqQuitthemancommand stringSearchforwardforinformationnFindthenextoccurrenceofstring man manisyourfriend ArekeyboardcharacterswithspecialmeaningtotheshellExamples ExceptThedot andunderscore Ch4Metacharacters Representszeroormorecharacterslsd Asterisk Representsanysinglecharacterlsd lsz txt QuestionMark Matchasetorrangeofcharacterstoasinglecharacterpositionls b f b ls fF f a c SquareBrackets Entermultiplecommandsonacommandlinecd lsdate cal pwd Semicolon Use toredirecttheoutputofacommandtoafileratherthantothescreenUse toappendtheoutputofacommandtoanexistingfilecal102004 a txtcal112004 a 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 n filename s tail n filename s tail 30 usr dict words head tail Commandmode Last linemode Entrymode Escape Return iao Ch6vi FullScreenTextEditor vifilenameOpenorcreateafileviOpenanewfiletobenamedlat

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论