SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
The Shell Game 3



         Kevin O'Brien
Washtenaw Linux Users Group
   http://www.lugwash.org
The Bourne-Again Shell (bash)
●   Now that we have looked at some general
    ideas about shells, and looked at the choices
    that are available, it is time to focus on the shell
    we will use for the rest of the series
●   The Bourne-Again Shell (bash) is the default on
    all Linux systems
●   It is as universal as anything can be in the
    world of Unix-like systems
●   So if you only learn one shell, this is the one to
                                                     2
    learn
Bash commands
●   Most Linux commands are separate files
●   You can find them by name on your hard drive
●   You can open a man page for them
●   But bash commands are all internal to bash
●   You cannot find them on your hard drive
●   They do not have a man page
●   Instead, they are all in the man page for bash
                                                 3
Examples
Just some of the bash commands




alias   bind     cd        dirs
echo    eval     exec      exit
hash    help     history   jobs
kill    logout   pwd       read
set     source   suspend   times
trap    type     umask     wait


                                   4
Navigating
●   A good starting point for bash is learning to
    move around
●   This is done with the cd command
●   Did you note that cd is one of the built-in
    commands in bash?
●   That means the information about it is in the
    bash man page

                                                    5
Cd 1
●   This stands for Change Directory
●   More precisely, it should be Change the
    Current Working Directory
●   This is often the most convenient way to
    execute other commands, even if they could
    be done some other way
●   For example, you could change the working
    directory so that you could then work on a file
    in that directory                             6
Cd 2
●   The syntax for this command is

    cd [option] [directory]

●   The arguments in brackets are themselves
    optional, i.e., you can successfully execute the
    command without specifying either an option
    or a directory

                                                 7
Shortcuts
●   In Unix-like operating systems the current
    directory can be represented by a dot
●   The parent directory is represented by two
    dots
●   The home directory is represented by ~ (called
    a tilde, found in the upper left of the keyboard)


                                                  8
Cd options
●   There are only two, and they are not
    commonly used (-P, -L)
●   These involve either following or not not
    following symbolic links
●   So we won't discuss them further at this time



                                                9
Absolute paths
●   These are paths that begin with the root (/) of
    the system
●   An example might be /home/kevin/Downloads,
    which is where all of my downloaded files go
●   Relative paths are paths relative to the current
    working directory
●   So, if I had a sub-directory of my Downloads
    directory, for example Firefox, I could give it the
    relative path /Firefox if I am in my Downloads10
    directory
Present Working Directory
●   The directory you are currently in is also
    known as the Present Working Directory
●   The command to display this is pwd
●   Did you notice this is also a built-in bash
    command?
●   This means you can find more info about it in
    the bash man page
●   You may not need this as much if your bash
    prompt displays the current directory     11
Exercises 1
●   First, use the pwd command to display your
    Present Working Directory
●   To go to /usr/local/share, type
    cd /usr/local/share
●   To go to your home directory, type
    cd ~
●   To go back to /usr/local/share, type
    cd
                                                 12
Exercises 2
●   To go to /usr/local/share/man type
    cd /man
●   To go back to /usr/local/share, type
    cd ..
●   To go the the root of the system, type
    cd /


                                             13
Practice these commands
●   To be really proficient you need to have these
    commands memorized
●   They are not all that complicated
●   Navigation is so essential that you don't want
    to be stopping to try and look up how to
    navigate when you are fixing a problem
●   How do you get to Carnegie Hall?

                                                14
Resources
●   The bash man page (you can also read this
    online at http://linux.die.net/man/1/bash)
●   The Bash Reference Manual at
    http://www.gnu.org/software/bash/manual/bas
    href.html
●   You have man pages on your computer, and
    they are there even if you are not connected
    to the Internet. So get to know how to use the
    man pages that are already on your hard 15
    drive.

Mais conteúdo relacionado

Mais procurados

Linux: A Getting Started Presentation
Linux: A Getting Started PresentationLinux: A Getting Started Presentation
Linux: A Getting Started Presentation
Nap Ramirez
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 

Mais procurados (20)

Linux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.comLinux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.com
 
리눅스 간단 강의 5강
리눅스 간단 강의 5강리눅스 간단 강의 5강
리눅스 간단 강의 5강
 
Basic C L I
Basic  C L IBasic  C L I
Basic C L I
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformatics
 
Linux: A Getting Started Presentation
Linux: A Getting Started PresentationLinux: A Getting Started Presentation
Linux: A Getting Started Presentation
 
RamDisk
RamDiskRamDisk
RamDisk
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Contribuir a Drupal - Entorno
Contribuir a Drupal - EntornoContribuir a Drupal - Entorno
Contribuir a Drupal - Entorno
 
Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archive
 
Unix for Librarians
Unix for LibrariansUnix for Librarians
Unix for Librarians
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Linux Getting Started
Linux Getting StartedLinux Getting Started
Linux Getting Started
 
Unix commands
Unix commandsUnix commands
Unix commands
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
Basic
BasicBasic
Basic
 
Day 2-some fun coding
Day 2-some fun codingDay 2-some fun coding
Day 2-some fun coding
 
Cli2 Bibalex
Cli2 BibalexCli2 Bibalex
Cli2 Bibalex
 
Linux Privilege Escalation with Lin Security.
Linux Privilege Escalation with Lin Security.Linux Privilege Escalation with Lin Security.
Linux Privilege Escalation with Lin Security.
 

Destaque (7)

Live with cli(bash)
Live with cli(bash)Live with cli(bash)
Live with cli(bash)
 
Bash Geekcamp
Bash GeekcampBash Geekcamp
Bash Geekcamp
 
Bash in theory and in practice - part one
Bash in theory and in practice - part oneBash in theory and in practice - part one
Bash in theory and in practice - part one
 
Bash in theory and in practice - part two
Bash in theory and in practice - part twoBash in theory and in practice - part two
Bash in theory and in practice - part two
 
bash
bashbash
bash
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
 
Bash 4
Bash 4Bash 4
Bash 4
 

Semelhante a The Shell Game Part 3: Introduction to Bash

Lpi Part 1 Linux Fundamentals
Lpi Part 1 Linux FundamentalsLpi Part 1 Linux Fundamentals
Lpi Part 1 Linux Fundamentals
YemenLinux
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
Mustafa Qasim
 

Semelhante a The Shell Game Part 3: Introduction to Bash (20)

Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Intro to Bash
Intro to BashIntro to Bash
Intro to Bash
 
The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?
 
Linux shell ggsipu-lug
Linux shell ggsipu-lugLinux shell ggsipu-lug
Linux shell ggsipu-lug
 
Lpi Part 1 Linux Fundamentals
Lpi Part 1 Linux FundamentalsLpi Part 1 Linux Fundamentals
Lpi Part 1 Linux Fundamentals
 
Linux Administration for Developers
Linux Administration for DevelopersLinux Administration for Developers
Linux Administration for Developers
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.
 
Operating system lab manual
Operating system lab manualOperating system lab manual
Operating system lab manual
 
OS Lab Manual.pdf
OS Lab Manual.pdfOS Lab Manual.pdf
OS Lab Manual.pdf
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
3 technical-dns-workshop-day2
3 technical-dns-workshop-day23 technical-dns-workshop-day2
3 technical-dns-workshop-day2
 
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows AdminsThe Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Installing Software, Part 3: Command Line
Installing Software, Part 3: Command LineInstalling Software, Part 3: Command Line
Installing Software, Part 3: Command Line
 
Licão 05 scripts exemple
Licão 05 scripts exempleLicão 05 scripts exemple
Licão 05 scripts exemple
 
File system discovery
File system discovery File system discovery
File system discovery
 
Adhocr T-dose 2012
Adhocr T-dose 2012Adhocr T-dose 2012
Adhocr T-dose 2012
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
 

Mais de Kevin OBrien

Mais de Kevin OBrien (19)

American icon pmi
American icon   pmiAmerican icon   pmi
American icon pmi
 
Tls 1.3
Tls 1.3Tls 1.3
Tls 1.3
 
Forward Secrecy
Forward SecrecyForward Secrecy
Forward Secrecy
 
Diffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key ExchangeDiffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key Exchange
 
Password best practices and the last pass hack
Password best practices and the last pass hackPassword best practices and the last pass hack
Password best practices and the last pass hack
 
SSL certificates
SSL certificatesSSL certificates
SSL certificates
 
Encryption basics
Encryption basicsEncryption basics
Encryption basics
 
Passwords
PasswordsPasswords
Passwords
 
Hardware Discovery Commands
Hardware Discovery CommandsHardware Discovery Commands
Hardware Discovery Commands
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Help, my computer is sluggish
Help, my computer is sluggishHelp, my computer is sluggish
Help, my computer is sluggish
 
The ps Command
The ps CommandThe ps Command
The ps Command
 
Installing Software, Part 2: Package Managers
Installing Software, Part 2: Package ManagersInstalling Software, Part 2: Package Managers
Installing Software, Part 2: Package Managers
 
Installing Software, Part 1 - Repositories
Installing Software, Part 1 - RepositoriesInstalling Software, Part 1 - Repositories
Installing Software, Part 1 - Repositories
 
Installing Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsInstalling Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System Considerations
 
The ifconfig Command
The ifconfig CommandThe ifconfig Command
The ifconfig Command
 
Find and Locate: Two Commands
Find and Locate: Two CommandsFind and Locate: Two Commands
Find and Locate: Two Commands
 
The Shell Game Part 4: Bash Shortcuts
The Shell Game Part 4: Bash ShortcutsThe Shell Game Part 4: Bash Shortcuts
The Shell Game Part 4: Bash Shortcuts
 
The Shell Game Part 1: What is a shell?
The Shell Game Part 1: What is a shell?The Shell Game Part 1: What is a shell?
The Shell Game Part 1: What is a shell?
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
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
 

The Shell Game Part 3: Introduction to Bash

  • 1. The Shell Game 3 Kevin O'Brien Washtenaw Linux Users Group http://www.lugwash.org
  • 2. The Bourne-Again Shell (bash) ● Now that we have looked at some general ideas about shells, and looked at the choices that are available, it is time to focus on the shell we will use for the rest of the series ● The Bourne-Again Shell (bash) is the default on all Linux systems ● It is as universal as anything can be in the world of Unix-like systems ● So if you only learn one shell, this is the one to 2 learn
  • 3. Bash commands ● Most Linux commands are separate files ● You can find them by name on your hard drive ● You can open a man page for them ● But bash commands are all internal to bash ● You cannot find them on your hard drive ● They do not have a man page ● Instead, they are all in the man page for bash 3
  • 4. Examples Just some of the bash commands alias bind cd dirs echo eval exec exit hash help history jobs kill logout pwd read set source suspend times trap type umask wait 4
  • 5. Navigating ● A good starting point for bash is learning to move around ● This is done with the cd command ● Did you note that cd is one of the built-in commands in bash? ● That means the information about it is in the bash man page 5
  • 6. Cd 1 ● This stands for Change Directory ● More precisely, it should be Change the Current Working Directory ● This is often the most convenient way to execute other commands, even if they could be done some other way ● For example, you could change the working directory so that you could then work on a file in that directory 6
  • 7. Cd 2 ● The syntax for this command is cd [option] [directory] ● The arguments in brackets are themselves optional, i.e., you can successfully execute the command without specifying either an option or a directory 7
  • 8. Shortcuts ● In Unix-like operating systems the current directory can be represented by a dot ● The parent directory is represented by two dots ● The home directory is represented by ~ (called a tilde, found in the upper left of the keyboard) 8
  • 9. Cd options ● There are only two, and they are not commonly used (-P, -L) ● These involve either following or not not following symbolic links ● So we won't discuss them further at this time 9
  • 10. Absolute paths ● These are paths that begin with the root (/) of the system ● An example might be /home/kevin/Downloads, which is where all of my downloaded files go ● Relative paths are paths relative to the current working directory ● So, if I had a sub-directory of my Downloads directory, for example Firefox, I could give it the relative path /Firefox if I am in my Downloads10 directory
  • 11. Present Working Directory ● The directory you are currently in is also known as the Present Working Directory ● The command to display this is pwd ● Did you notice this is also a built-in bash command? ● This means you can find more info about it in the bash man page ● You may not need this as much if your bash prompt displays the current directory 11
  • 12. Exercises 1 ● First, use the pwd command to display your Present Working Directory ● To go to /usr/local/share, type cd /usr/local/share ● To go to your home directory, type cd ~ ● To go back to /usr/local/share, type cd 12
  • 13. Exercises 2 ● To go to /usr/local/share/man type cd /man ● To go back to /usr/local/share, type cd .. ● To go the the root of the system, type cd / 13
  • 14. Practice these commands ● To be really proficient you need to have these commands memorized ● They are not all that complicated ● Navigation is so essential that you don't want to be stopping to try and look up how to navigate when you are fixing a problem ● How do you get to Carnegie Hall? 14
  • 15. Resources ● The bash man page (you can also read this online at http://linux.die.net/man/1/bash) ● The Bash Reference Manual at http://www.gnu.org/software/bash/manual/bas href.html ● You have man pages on your computer, and they are there even if you are not connected to the Internet. So get to know how to use the man pages that are already on your hard 15 drive.