資源描述:
《unix basics(the unix file system)課件》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、Lecture2UNIXBasicsTheUNIXFilesystemOnthelastepisodeofOpenSourceTools…CourseInfoHistoryofUNIXandOpenSourceHighlightsofUNIXTheUNIXPhilosophySystemorganizationUnixSystemStructureusershellandutilitieskernelhardwarecprogramsscriptslsshgccfindopen()fork()exec()KernelSubsystemsFilesystemDealswith
2、allinputandoutputIncludesfilesandterminalsIntegrationofstoragedevicesProcessmanagementDealswithprogramsandprograminteractionHowprocessesshareCPU,memoryandsignalsSchedulingInterprocessCommunicationMemorymanagementUNIXvariantshavedifferentimplementationsofdifferentsubsystems.Whatisashell?Theuseri
3、nterfacetotheoperatingsystemFunctionality:ExecuteotherprogramsManagefilesManageprocessesAprogramlikeanyotherExecutedwhenyoulogonMostCommonlyUsedShells/bin/shTheBourneShell/POSIXshell/bin/cshCshell/bin/tcshEnhancedCShell/bin/kshKornshell/bin/bashOpenSourcekshcloneBasicformofshell:while(readcomma
4、nd){parsecommandexecutecommand}ShellInteractiveUseWhenyoulogin,youinteractivelyusetheshell:CommandhistoryCommandlineeditingFileexpansion(tabcompletion)CommandexpansionKeybindingsSpellingcorrectionJobcontrolShellScriptingAsetofshellcommandsthatconstituteanexecutableprogramAshellscriptisaregul
5、artextfilethatcontainsshellorUNIXcommandsVeryusefulforautomatingrepetitivetaskandadministrativetoolsandforstoringcommandsforlaterexecutionSimpleCommandssimplecommand:sequenceofnonblanksargumentsseparatedbyblanksortabs.1stargument(numberedzero)usuallyspecifiesthenameofthecommandtobeexecuted.Anyr
6、emainingarguments:Arepassedasargumentstothatcommand.Argumentsmaybefilenames,pathnames,directoriesorspecialoptions(uptocommand)SpecialcharactersareinterpretedbyshellAsimpleexampleExecuteabasiccommandParsingacommandintoargumentsiscalledsplitting$ls–l/bin-rwxr-xr-x1rootsys43234Sep102008date$prompt
7、commandargumentsTypesofArgumentsOptions/FlagsConvention:-Xor--longnameParametersMaybefiles,maybestringsDependsoncommand$tar–c–v–farchive.tarmain.cmain.hGettingHelponUNIXman:displayentriesfromUNIXonlinedocumentationwhatis,aproposMa