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 full-size slide

  2. !
    echo $PATH
    kimschles 2

    View full-size 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 full-size slide

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

    View full-size slide

  5. Editing $PATH
    kimschles 5

    View full-size 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 full-size 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 full-size slide

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

    View full-size 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 full-size slide

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

    View full-size slide

  11. kimschlesinger.com
    hirediversity.us
    kimschles 11

    View full-size slide