Upgrade to Pro — share decks privately, control downloads, hide ads and more …

$PATH

 $PATH

A lightning talk breaking down the $PATH variable.

Kim Schlesinger

November 20, 2018
Tweet

More Decks by Kim Schlesinger

Other Decks in Technology

Transcript


  1. $PATH
    kimschles 1

    View Slide

  2. !
    echo $PATH
    kimschles 2

    View Slide

  3. /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
    • Environment Variable
    • 1 long string
    • Colon-separated
    • Is a path to executable code invoked through text commands
    kimschles 3

    View Slide

  4. /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
    /usr/local/bin
    /usr/bin
    /bin
    /usr/sbin
    /sbin
    kimschles 4

    View Slide

  5. Editing $PATH
    kimschles 5

    View Slide

  6. Permanent Change
    Add to .bashrc or right from the command line.
    export PATH=$PATH:/Library/Frameworks/Python.framework/
    Versions/3.5/bin
    kimschles 6

    View Slide

  7. Temporary Change
    From the command line. Only lasts in current shell (no export)
    PATH=$PATH:/Library/Frameworks/Python.framework/Versions/
    3.5/bin
    kimschles 7

    View Slide

  8. Recapitulation
    • Environment Variable
    • 1 long string
    • Colon-separated
    • Is a path to executable code invoked through text commands
    kimschles 8

    View Slide

  9. Recapitulation
    • See it with
    echo $PATH
    • Change it with export:
    export PATH=$PATH:/Library/Frameworks/new/thing
    • Try out a new path by taking out export:
    PATH=$PATH:/Library/Frameworks/new/thing
    kimschles 9

    View Slide

  10. Resources
    • How to Access and Edit Path
    • The /bin Directory
    kimschles 10

    View Slide

  11. kimschlesinger.com
    hirediversity.us
    kimschles 11

    View Slide