Linux - Module 4: Command line skills

The ; character - Used to separate commands on a command line The && characters – Used to execute the second command if the first command succeeds The || characters – Used to execute the second command if the first command fails

pptx19 trang | Chia sẻ: nguyenlam99 | Lượt xem: 977 | Lượt tải: 0download
Bạn đang xem nội dung tài liệu Linux - Module 4: Command line skills, để tải tài liệu về máy bạn click vào nút DOWNLOAD ở trên
Module 4 Command Line SkillsExam Objective 2.1 Basics of using the Linux command lineObjective SummaryUnderstanding the basic shellWorking with formatting commands and optionsLearn the effects of variables, globbing and quotingCLI or Basic ShellThe Command Line Interface Text based interface Access via a TerminalGUI-based terminalsVirtual terminalsCommands passed to a shellShell prompt: [sysadmin@localhost ~]Shell FeaturesCommand history – ability to re-execute previous commands quicklyScripting – create programs by placing shell commands in a file to runAlias – create shortcuts to longer commandsVariables – store information that can be used to modify the functionality of the shell or commandsUnderstanding Command StructureCommand formatBasic format: command [options] [arguments]Options change the behavior of commandArguments are used to provide additional information for a commandCommand optionsVary based on command Older option format: -aCan be combined: -abc = -a -b -cNewer (GNU) option format: --allCommand HistoryView previous commands: historyBring up previous commands: up arrowModify previous commands: left arrow, right arrow, etc.Execute a previous command: !VariablesShell VariablesUsed to store system informationView with echo command: echo $HISTSIZEModify: HISTSIZE = 500Changes are temporaryPlace commands in ~/.bashrc to make permanentPATH VariableDetermines where commands are executed fromMay need to be modified for custom softwareExample: Command Path and AliasesFind command locationHard to determine where a command is locatedInstead of searching directories in the PATH variable manually, use the which command:which calwhich dateAliasesUsed to make shortcuts for longer commandsView aliases: aliasCreate alias: alias name=commandChange are temporaryTo make permanent, place alias command in ~/.bashrc fileAdditional Command StructureGlobbingUsed to match sets of files in a directory* = match zero or more of any characters? = match exactly one of any character[ ] = match exactly one of a set of characters:echo [abc]*.txtecho [!abc]*.txt QuotingDouble quotes – used to disable the meaning of some metacharacters, like glob charactersSingle quotes – used to disable the meaning of all metacharactersCan use \ to disable next character onlyBackquotes – used to execute a command within another command lineControl StatementsThe ; character - Used to separate commands on a command lineThe && characters – Used to execute the second command if the first command succeedsThe || characters – Used to execute the second command if the first command fails

Các file đính kèm theo tài liệu này:

  • pptxle_module_04_2414.pptx
Tài liệu liên quan