SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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
 

Similar a Unit 6 bash shell

Similar a 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
 

Último

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

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)"