SlideShare a Scribd company logo
1 of 21
Download to read offline
RedHat Enterprise Linux Essential
Unit 2: Running commands and Getting Help
Unit 2 : Running commands and Getting Help
   Running Commands
   Some Simple commands
   Getting Help
   The whatis Command
   The --help option
   Reading Usage summaries
   The man command
   Navigating man Pages
   The info command
   Navigating info Pages
   Extended Documentation
   RedHat Documentation
Running Commands


 Commands have the following syntax:

  command [options] [arguments]

 Each item is separated by a space

 Options modify the command's behavior

      Word options ussually proceded by “--“

      Single-leeter options usually preceded by "-“

      can be passed as "-a -b -c" or "-abc“

 Arguments are filenames or other data needed by the command
Some Simple Commands


 su - username : change user ( or su username)

 id username       shows information on the current user

 date - display date and time

 cal - display calendar
Getting Help

 Don't try to memories everthing!
 Many levels of help
   Whatis
   <command> --help
   man and info
   /usr/share/doc
   Red Hat documentation
The whatis command


 Display short descriptions of commands

  ex: whatis ls
The --help option


 Displays usage summary and argument list

 Used by most, but not all, commands

  Ex:       ls --help
Reading Usage Summaries


 Printed by --help, man and others

 Used to describe the syntax of a command
    Arguments in "[ ]" are optional

    Arguments in "<>" are variables

    x|y|z means "x or y or z”

    -abc mean "any mix of -a, -b or -c"
The man command


 Provides command descriptions or manuals

 Almost every command has a man "page“

 Pages are grouped into "chapters“

 Collectively referred to as the Linux Manual

            man [<chapter>] <command>
Navigating man Pages


 While viewing a man page
   Navigate with arrows, pgUp, pgDown

   /<text>                Search for text
   n/N                    Next/Privous match
   q                      Quit viewing page

 Searching the Manual
   man -k <keyword>       List all matching pages
The info command


 Similar to man, but offten more in-depth

 info pages are structured like a web site

    Each page is divided into "nodes”

    Links to nodes are preceded by "*"


              info <command>
Navigating info Pages


 While viewing an info page
    Navigate with arrows, pgUp, pgDown

    Tab             move the next link
    Enter           Follow link the cursor is on
    n/p/u           View next/previous/up-one node
    s[<text>]       Search for text
    Ctr + S         Search for next text
    q               Quit vewing page
Extended Documentation




/usr/share/doc
Redhat Documentation Doc




http://www.redhat.com/docs
Sequence 1: Using the Help Tools
 1. Look at the command-line options for the man command. What man option can be
   used to search the name of every manual page for a keyword and list the matches
   (the same behavior as whatis)?
 2. What man option can be used to search the name and short description of every
   manual page for a keyword and list the matching pages?
 3. What man option can be used to search the entire text (not just the names and
   short descriptions) of the manual for a keyword, displaying the matching pages one
   at a time?
 4. Suppose you wanted to view the man page for the basename function of the C
   programming language, as opposed to that of the basename command. How might
   you do that? HINT: C functions are discussed in chapter 3 of the manual
Sequence 1: Using the Help Tools
 5. What command-line options might you use to cause ls to display a long
  listing of files with human-readable size descriptions (i.e., 6.8M instead of
  6819467)? HINT: You will need two command-line options.
 6. Given the usage description below, which of the following would be a
  syntactically valid invocation of the command foo?

               foo -x|-y [-abcde] FILENAME...
               a. foo -x -y -a one.txt

               b. foo

               c. foo -y -abc one.txt two.txt

               d. foo -abc one.txt two.txt three.txt
Sequence 2: Solving Problems with man
Scenario:       You want to change /etc/issue again (see previous lab). This
                time you want to see if there is an escape to make it print the
                system's hostname.

1. Begin by consulting the man page for /etc/issue

        [vmintam@localhost ~]$ man issue

   Note that it says escape characters are dependent upon mingetty. Note
   also the reference to mingetty(8) in the See Also section.Exit the man page
   by pressing q.

2. Continue your search by looking at the mingetty man page. Do you need to
   specify chapter 8 when requesting the page? Why or why not?
Sequence 2: Solving Problems with man
3. Jump to the section on escapes by typing

  /escape

  Your cursor should be on the heading ISSUE ESCAPES. If it is not, press n
  to move between matches until it is. This section discusses the escape
  sequences introduced in a previous exercise.



4. Which escape represents the system's hostname?
Sequence 2: Solving Problems with man
3. Jump to the section on escapes by typing

  /escape

  Your cursor should be on the heading ISSUE ESCAPES. If it is not, press n
  to move between matches until it is. This section discusses the escape
  sequences introduced in a previous exercise.



4. Which escape represents the system's hostname?
Sequence 2: Solving Problems with man
5. Open /etc/issue in nano

   [root@localhost ~]# nano /etc/issue

6. Change the welcome message you added previously to include the hostname
   escape. /etc/issue should now look similar to this:
    Welcome to n!

    Red Hat Enterprise Linux Server release 5

    Kernel r on an m

7. Save the file and exit nano by pressing Ctrl-x.

8. Log out by closing your shell with the exit command. This should drop you
   back to a new and improved login prompt! Try accessing other virtual terminals
   and seeing how the prompt changes. Remember that you may need to press
   Enter to see an updated prompt.
Here are the answers to the questions in Sequence 2:2. No, you do not need to specify chapter 8 when requesting the mingetty man page. Man pages are grouped into numbered sections (chapters), but you do not need to specify the chapter number unless there is a name conflict between commands and sections. 4. The \h escape represents the system's hostname

More Related Content

What's hot

Linux for CS Majors
Linux for CS MajorsLinux for CS Majors
Linux for CS Majorsworr1244
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformaticsBonnie Ng
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administratorAisha Talat
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04spDr.Ravi
 
linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
 
Productivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformaticsProductivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformaticsBITS
 
Using the MS Windows Command Line
Using the MS Windows Command LineUsing the MS Windows Command Line
Using the MS Windows Command Lineadil raja
 
Directory Commands - R.D.Sivakumar
Directory Commands - R.D.SivakumarDirectory Commands - R.D.Sivakumar
Directory Commands - R.D.SivakumarSivakumar R D .
 

What's hot (20)

Basic C L I
Basic  C L IBasic  C L I
Basic C L I
 
ppt on cmd cammand
ppt on cmd cammandppt on cmd cammand
ppt on cmd cammand
 
Linux for CS Majors
Linux for CS MajorsLinux for CS Majors
Linux for CS Majors
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
Dos
DosDos
Dos
 
MS-DOS
MS-DOSMS-DOS
MS-DOS
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformatics
 
BASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUXBASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUX
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
 
Sahul
SahulSahul
Sahul
 
Linux comands for Beginners
Linux comands for BeginnersLinux comands for Beginners
Linux comands for Beginners
 
linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014
 
Msdos crash course
Msdos crash courseMsdos crash course
Msdos crash course
 
Productivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformaticsProductivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformatics
 
Sahu
SahuSahu
Sahu
 
Using the MS Windows Command Line
Using the MS Windows Command LineUsing the MS Windows Command Line
Using the MS Windows Command Line
 
Se meu elefante falasse
Se meu elefante falasseSe meu elefante falasse
Se meu elefante falasse
 
Directory Commands - R.D.Sivakumar
Directory Commands - R.D.SivakumarDirectory Commands - R.D.Sivakumar
Directory Commands - R.D.Sivakumar
 
Linux Basics
Linux BasicsLinux Basics
Linux Basics
 

Viewers also liked

Unit 4 user and group
Unit 4 user and groupUnit 4 user and group
Unit 4 user and grouproot_fibo
 
Unit 6 bash shell
Unit 6 bash shellUnit 6 bash shell
Unit 6 bash shellroot_fibo
 
Unit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell scriptUnit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell scriptroot_fibo
 
Unit 13 network client
Unit 13 network clientUnit 13 network client
Unit 13 network clientroot_fibo
 
Unit 9 basic system configuration tools
Unit 9 basic system configuration toolsUnit 9 basic system configuration tools
Unit 9 basic system configuration toolsroot_fibo
 
Administration 1 sw2012
Administration 1 sw2012Administration 1 sw2012
Administration 1 sw2012Lin Liyue
 
Unit 12 finding and processing files
Unit 12 finding and processing filesUnit 12 finding and processing files
Unit 12 finding and processing filesroot_fibo
 

Viewers also liked (7)

Unit 4 user and group
Unit 4 user and groupUnit 4 user and group
Unit 4 user and group
 
Unit 6 bash shell
Unit 6 bash shellUnit 6 bash shell
Unit 6 bash shell
 
Unit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell scriptUnit 11 configuring the bash shell – shell script
Unit 11 configuring the bash shell – shell script
 
Unit 13 network client
Unit 13 network clientUnit 13 network client
Unit 13 network client
 
Unit 9 basic system configuration tools
Unit 9 basic system configuration toolsUnit 9 basic system configuration tools
Unit 9 basic system configuration tools
 
Administration 1 sw2012
Administration 1 sw2012Administration 1 sw2012
Administration 1 sw2012
 
Unit 12 finding and processing files
Unit 12 finding and processing filesUnit 12 finding and processing files
Unit 12 finding and processing files
 

Similar to Here are the answers to the questions in Sequence 2:2. No, you do not need to specify chapter 8 when requesting the mingetty man page. Man pages are grouped into numbered sections (chapters), but you do not need to specify the chapter number unless there is a name conflict between commands and sections. 4. The \h escape represents the system's hostname

Similar to Here are the answers to the questions in Sequence 2:2. No, you do not need to specify chapter 8 when requesting the mingetty man page. Man pages are grouped into numbered sections (chapters), but you do not need to specify the chapter number unless there is a name conflict between commands and sections. 4. The \h escape represents the system's hostname (20)

Chapter 3 Using Unix Commands
Chapter 3 Using Unix CommandsChapter 3 Using Unix Commands
Chapter 3 Using Unix Commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Red hat linux essentials
Red hat linux essentialsRed hat linux essentials
Red hat linux essentials
 
The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
Linux introductory-course-day-1
Linux introductory-course-day-1Linux introductory-course-day-1
Linux introductory-course-day-1
 
COMMAND.pptx
COMMAND.pptxCOMMAND.pptx
COMMAND.pptx
 
IntroCommandLine.ppt
IntroCommandLine.pptIntroCommandLine.ppt
IntroCommandLine.ppt
 
IntroCommandLine.ppt
IntroCommandLine.pptIntroCommandLine.ppt
IntroCommandLine.ppt
 
60761 linux
60761 linux60761 linux
60761 linux
 
Linux programming - Getting self started
Linux programming - Getting self started Linux programming - Getting self started
Linux programming - Getting self started
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Nithi
NithiNithi
Nithi
 
02 linux desktop usage
02 linux desktop usage02 linux desktop usage
02 linux desktop usage
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Group13
Group13Group13
Group13
 
Using Unix Commands.pptx
Using Unix Commands.pptxUsing Unix Commands.pptx
Using Unix Commands.pptx
 
Using Unix Commands.pptx
Using Unix Commands.pptxUsing Unix Commands.pptx
Using Unix Commands.pptx
 

Recently uploaded

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Here are the answers to the questions in Sequence 2:2. No, you do not need to specify chapter 8 when requesting the mingetty man page. Man pages are grouped into numbered sections (chapters), but you do not need to specify the chapter number unless there is a name conflict between commands and sections. 4. The \h escape represents the system's hostname

  • 1. RedHat Enterprise Linux Essential Unit 2: Running commands and Getting Help
  • 2. Unit 2 : Running commands and Getting Help  Running Commands  Some Simple commands  Getting Help  The whatis Command  The --help option  Reading Usage summaries  The man command  Navigating man Pages  The info command  Navigating info Pages  Extended Documentation  RedHat Documentation
  • 3. Running Commands  Commands have the following syntax: command [options] [arguments]  Each item is separated by a space  Options modify the command's behavior  Word options ussually proceded by “--“  Single-leeter options usually preceded by "-“  can be passed as "-a -b -c" or "-abc“  Arguments are filenames or other data needed by the command
  • 4. Some Simple Commands  su - username : change user ( or su username)  id username shows information on the current user  date - display date and time  cal - display calendar
  • 5. Getting Help  Don't try to memories everthing!  Many levels of help  Whatis  <command> --help  man and info  /usr/share/doc  Red Hat documentation
  • 6. The whatis command  Display short descriptions of commands ex: whatis ls
  • 7. The --help option  Displays usage summary and argument list  Used by most, but not all, commands Ex: ls --help
  • 8. Reading Usage Summaries  Printed by --help, man and others  Used to describe the syntax of a command  Arguments in "[ ]" are optional  Arguments in "<>" are variables  x|y|z means "x or y or z”  -abc mean "any mix of -a, -b or -c"
  • 9. The man command  Provides command descriptions or manuals  Almost every command has a man "page“  Pages are grouped into "chapters“  Collectively referred to as the Linux Manual man [<chapter>] <command>
  • 10. Navigating man Pages  While viewing a man page  Navigate with arrows, pgUp, pgDown  /<text> Search for text  n/N Next/Privous match  q Quit viewing page  Searching the Manual  man -k <keyword> List all matching pages
  • 11. The info command  Similar to man, but offten more in-depth  info pages are structured like a web site  Each page is divided into "nodes”  Links to nodes are preceded by "*" info <command>
  • 12. Navigating info Pages  While viewing an info page  Navigate with arrows, pgUp, pgDown  Tab move the next link  Enter Follow link the cursor is on  n/p/u View next/previous/up-one node  s[<text>] Search for text  Ctr + S Search for next text  q Quit vewing page
  • 15. Sequence 1: Using the Help Tools  1. Look at the command-line options for the man command. What man option can be used to search the name of every manual page for a keyword and list the matches (the same behavior as whatis)?  2. What man option can be used to search the name and short description of every manual page for a keyword and list the matching pages?  3. What man option can be used to search the entire text (not just the names and short descriptions) of the manual for a keyword, displaying the matching pages one at a time?  4. Suppose you wanted to view the man page for the basename function of the C programming language, as opposed to that of the basename command. How might you do that? HINT: C functions are discussed in chapter 3 of the manual
  • 16. Sequence 1: Using the Help Tools  5. What command-line options might you use to cause ls to display a long listing of files with human-readable size descriptions (i.e., 6.8M instead of 6819467)? HINT: You will need two command-line options.  6. Given the usage description below, which of the following would be a syntactically valid invocation of the command foo? foo -x|-y [-abcde] FILENAME... a. foo -x -y -a one.txt b. foo c. foo -y -abc one.txt two.txt d. foo -abc one.txt two.txt three.txt
  • 17. Sequence 2: Solving Problems with man Scenario: You want to change /etc/issue again (see previous lab). This time you want to see if there is an escape to make it print the system's hostname. 1. Begin by consulting the man page for /etc/issue [vmintam@localhost ~]$ man issue Note that it says escape characters are dependent upon mingetty. Note also the reference to mingetty(8) in the See Also section.Exit the man page by pressing q. 2. Continue your search by looking at the mingetty man page. Do you need to specify chapter 8 when requesting the page? Why or why not?
  • 18. Sequence 2: Solving Problems with man 3. Jump to the section on escapes by typing /escape Your cursor should be on the heading ISSUE ESCAPES. If it is not, press n to move between matches until it is. This section discusses the escape sequences introduced in a previous exercise. 4. Which escape represents the system's hostname?
  • 19. Sequence 2: Solving Problems with man 3. Jump to the section on escapes by typing /escape Your cursor should be on the heading ISSUE ESCAPES. If it is not, press n to move between matches until it is. This section discusses the escape sequences introduced in a previous exercise. 4. Which escape represents the system's hostname?
  • 20. Sequence 2: Solving Problems with man 5. Open /etc/issue in nano [root@localhost ~]# nano /etc/issue 6. Change the welcome message you added previously to include the hostname escape. /etc/issue should now look similar to this: Welcome to n! Red Hat Enterprise Linux Server release 5 Kernel r on an m 7. Save the file and exit nano by pressing Ctrl-x. 8. Log out by closing your shell with the exit command. This should drop you back to a new and improved login prompt! Try accessing other virtual terminals and seeing how the prompt changes. Remember that you may need to press Enter to see an updated prompt.