SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
RedHat Enterprise Linux Essential
        Unit 6: The bash shell
Objectives
Upon completion of this unit, you should be able to:
 Use command-line shortcuts

 Use command-line expansion

 Use history and editing tricks

 Use the gnome-terminal
Bash Introduction

 "bourne Again Shell"

 Successor to sh, the original Unix shell
Bash Introduction
Bash Heritage
Command Line Shortcuts: File Globbing

 Globbing is wildcard expansion:

      .*                  matches zero or more characters

      .?                  matches any single character

      .[a-z]              matches a range of characters

      . [^a-z]            matches all except the range

ex:   touch test1.txt test2.txt test11.txt test1.mp3 test2.mp3

      ls *.txt ; ls test??.txt ; ls test[1-2].txt; ls test[^1].*
Command Line Shortcuts: The Tab Key

 Type Tab to complete command lines:
    For the command name, it will complete a command name

    For an argument, it will complete a file name

 Examples:
       $ xte<Tab>
       $ xterm
       $ ls myf<Tab>
       $ ls myfile.txt
Command Line Shortcuts: history


 Ex: history

 Try: !3

 Try: ^2^1

  example: ping 192.168.1.2

  try: ^2^1
Command Line Expansion: Tilde (~)

 Ex:    pwd

 cd ~

 cd /etc/

 cd ~

 cd ~user1
Command Line Expansion: Variable and Curly braces ({})



 echo $HOME

 cd /tmp

 touch {a,b}

 touch a{a,b}

 touch {a,b}.{1,2}
Command Line Expansion : Command and Math
Command Line Expansion : Command and Math


 hostname => localhost.localdomain (?)

 echo 'Hostname: "

 Echo Hostname: `hostname`“ ; echo Hostname:$(hostname)"

 Math: echo a, echo $HOME,

  echo $a . a=3 , echo $a

  echo $[$a + $c] ; echo $[$b + $c];

  echo $[$c / $b]; echo $[$b%$c]

  echo $[$a**$c]
Command Line Expansion: Backslash ()


 Backslash () is the escape character and makes the next
  character literal

       ex : echo Your cost is $5.00

 Used and last character on line to "continue command on
  next line“

  ex : ls
Command line expansion: Quotes

 Single quotes (')      inhibit all expansion

 Double quotes ('')     inhibit all expansion,

    except:
       • $

       •   `

       •   

       •   !
History Tricks

 use the up and down arrow keys to scroll throuht previous commans

 Type <CTRL-R> to search for a command in command history.

    (reverse-i-search)":

 To recall last argument from previous command:
    <ESC>.

    <ALT + .>

   Ex: ping 192.168.1.1

       telnet   <ESC> .
Command Editing Tricks
 Ctrl-a moves to beginning of line

 Ctrl-e moves to end of line

 Ctrl-u deletes to beginning of line

 Ctrl-k deletes to end of line

 Ctrl-arrow moves left or right by word
gnome - terminal
 Applications/ System Tools / Terminal

 <Ctr - shift -t>             open a new tab

 <Ctrl - pgUp/ PgDn>          Next/ Prev tab

 <Alt-"N">                    changr to go to "N" tab

 <Ctrl - Shift-c/v>           Copy/ Paste

 <Ctrl-Shift-w>               Close a tab
Scripting Basics
 Shell scripts are text files that contain a series of commands or
  statements to be executed.

 Shell scripts are useful for:
    Automating commonly used commands

    Performing system administration and troubleshooting

    Creating simple applications

    Manipulation of text or files
Creating Shell Scripts
 Step 1: Use such as vi to create a text file containing
  commands
    First line contains the magic shebang sequence: #!

      • #!/bin/bash

 Comment your scripts!
    Comments start with a #
Creating Shell Scripts
                             continued
 Step 2: Make the script executable:

       $ chmod u+x myscript.sh

 To execute the new script:
    Place the script file in a directory in the executable path -OR-

    Specify the absolute or relative path to the script on the command line
Sample Shell Script
#!/bin/bash

# This script displays some information about your
  environment

echo "Greetings. The date and time are $(date)"

echo "Your working directory is: $(pwd)"
Unit 6 bash shell

Weitere ähnliche Inhalte

Was ist angesagt?

Linux shell env
Linux shell envLinux shell env
Linux shell envRahul Pola
 
Shell & Shell Script
Shell & Shell Script Shell & Shell Script
Shell & Shell Script Amit Ghosh
 
system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarGauravRaikar3
 
Pipes and filters
Pipes and filtersPipes and filters
Pipes and filtersbhatvijetha
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsSudharsan S
 
DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foobrian_dailey
 
Unix Commands
Unix CommandsUnix Commands
Unix CommandsDr.Ravi
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scriptingvceder
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examplesabclearnn
 
Course 102: Lecture 7: Simple Utilities
Course 102: Lecture 7: Simple Utilities Course 102: Lecture 7: Simple Utilities
Course 102: Lecture 7: Simple Utilities Ahmed El-Arabawy
 

Was ist angesagt? (20)

Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
 
Shell programming
Shell programmingShell programming
Shell programming
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Linux shell env
Linux shell envLinux shell env
Linux shell env
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Shell & Shell Script
Shell & Shell Script Shell & Shell Script
Shell & Shell Script
 
Shellscripting
ShellscriptingShellscripting
Shellscripting
 
system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikar
 
Pipes and filters
Pipes and filtersPipes and filters
Pipes and filters
 
Unix shell scripting tutorial
Unix shell scripting tutorialUnix shell scripting tutorial
Unix shell scripting tutorial
 
Scripting and the shell in LINUX
Scripting and the shell in LINUXScripting and the shell in LINUX
Scripting and the shell in LINUX
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foo
 
Unix Commands
Unix CommandsUnix Commands
Unix Commands
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Course 102: Lecture 7: Simple Utilities
Course 102: Lecture 7: Simple Utilities Course 102: Lecture 7: Simple Utilities
Course 102: Lecture 7: Simple Utilities
 

Andere mochten auch

Unit 4 user and group
Unit 4 user and groupUnit 4 user and group
Unit 4 user and grouproot_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
 

Andere mochten auch (6)

Unit 4 user and group
Unit 4 user and groupUnit 4 user and group
Unit 4 user and group
 
Unit2 help
Unit2 helpUnit2 help
Unit2 help
 
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
 

Ähnlich wie Unit 6 bash shell

Ähnlich wie Unit 6 bash shell (20)

Using Unix
Using UnixUsing Unix
Using Unix
 
Session3
Session3Session3
Session3
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Unix
UnixUnix
Unix
 
101 3.1 gnu and unix commands
101 3.1 gnu and unix commands101 3.1 gnu and unix commands
101 3.1 gnu and unix commands
 
Unix tutorial-08
Unix tutorial-08Unix tutorial-08
Unix tutorial-08
 
60761 linux
60761 linux60761 linux
60761 linux
 
basic shell scripting syntex
basic shell scripting syntexbasic shell scripting syntex
basic shell scripting syntex
 
Linux com
Linux comLinux com
Linux com
 
Shell Scripting and Programming.pptx
Shell Scripting and Programming.pptxShell Scripting and Programming.pptx
Shell Scripting and Programming.pptx
 
Shell Scripting and Programming.pptx
Shell Scripting and Programming.pptxShell Scripting and Programming.pptx
Shell Scripting and Programming.pptx
 
IntroCommandLine.ppt
IntroCommandLine.pptIntroCommandLine.ppt
IntroCommandLine.ppt
 
IntroCommandLine.ppt
IntroCommandLine.pptIntroCommandLine.ppt
IntroCommandLine.ppt
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4
 

Kürzlich hochgeladen

"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
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
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
 

Kürzlich hochgeladen (20)

"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
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
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
 
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
 

Unit 6 bash shell

  • 1. RedHat Enterprise Linux Essential Unit 6: The bash shell
  • 2. Objectives Upon completion of this unit, you should be able to:  Use command-line shortcuts  Use command-line expansion  Use history and editing tricks  Use the gnome-terminal
  • 3. Bash Introduction  "bourne Again Shell"  Successor to sh, the original Unix shell
  • 6. Command Line Shortcuts: File Globbing  Globbing is wildcard expansion: .* matches zero or more characters .? matches any single character .[a-z] matches a range of characters . [^a-z] matches all except the range ex: touch test1.txt test2.txt test11.txt test1.mp3 test2.mp3 ls *.txt ; ls test??.txt ; ls test[1-2].txt; ls test[^1].*
  • 7. Command Line Shortcuts: The Tab Key  Type Tab to complete command lines:  For the command name, it will complete a command name  For an argument, it will complete a file name  Examples: $ xte<Tab> $ xterm $ ls myf<Tab> $ ls myfile.txt
  • 8. Command Line Shortcuts: history  Ex: history  Try: !3  Try: ^2^1 example: ping 192.168.1.2 try: ^2^1
  • 9. Command Line Expansion: Tilde (~)  Ex: pwd  cd ~  cd /etc/  cd ~  cd ~user1
  • 10. Command Line Expansion: Variable and Curly braces ({})  echo $HOME  cd /tmp  touch {a,b}  touch a{a,b}  touch {a,b}.{1,2}
  • 11. Command Line Expansion : Command and Math
  • 12. Command Line Expansion : Command and Math  hostname => localhost.localdomain (?)  echo 'Hostname: "  Echo Hostname: `hostname`“ ; echo Hostname:$(hostname)"  Math: echo a, echo $HOME, echo $a . a=3 , echo $a echo $[$a + $c] ; echo $[$b + $c]; echo $[$c / $b]; echo $[$b%$c] echo $[$a**$c]
  • 13. Command Line Expansion: Backslash ()  Backslash () is the escape character and makes the next character literal ex : echo Your cost is $5.00  Used and last character on line to "continue command on next line“ ex : ls
  • 14. Command line expansion: Quotes  Single quotes (') inhibit all expansion  Double quotes ('') inhibit all expansion,  except: • $ • ` • • !
  • 15. History Tricks  use the up and down arrow keys to scroll throuht previous commans  Type <CTRL-R> to search for a command in command history.  (reverse-i-search)":  To recall last argument from previous command:  <ESC>.  <ALT + .> Ex: ping 192.168.1.1 telnet <ESC> .
  • 16. Command Editing Tricks  Ctrl-a moves to beginning of line  Ctrl-e moves to end of line  Ctrl-u deletes to beginning of line  Ctrl-k deletes to end of line  Ctrl-arrow moves left or right by word
  • 17. gnome - terminal  Applications/ System Tools / Terminal  <Ctr - shift -t> open a new tab  <Ctrl - pgUp/ PgDn> Next/ Prev tab  <Alt-"N"> changr to go to "N" tab  <Ctrl - Shift-c/v> Copy/ Paste  <Ctrl-Shift-w> Close a tab
  • 18. Scripting Basics  Shell scripts are text files that contain a series of commands or statements to be executed.  Shell scripts are useful for:  Automating commonly used commands  Performing system administration and troubleshooting  Creating simple applications  Manipulation of text or files
  • 19. Creating Shell Scripts  Step 1: Use such as vi to create a text file containing commands  First line contains the magic shebang sequence: #! • #!/bin/bash  Comment your scripts!  Comments start with a #
  • 20. Creating Shell Scripts continued  Step 2: Make the script executable: $ chmod u+x myscript.sh  To execute the new script:  Place the script file in a directory in the executable path -OR-  Specify the absolute or relative path to the script on the command line
  • 21. Sample Shell Script #!/bin/bash # This script displays some information about your environment echo "Greetings. The date and time are $(date)" echo "Your working directory is: $(pwd)"