Skip to Content
Navigation:

A stick figure smiling

If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!

Image of a comic. To read the full HTML alt text, click "read the transcript".

browse more comics! get the zine!
read the transcript!

add a directory to your PATH

at the end:

export PATH=$PATH:/my/dir

at the beginning:

export PATH=/my/dir/:$PATH

in fish:

set -e PATH $PATH /my/dir

(illustration of a little fish with a heart-shaped tail)

you shell’s config file

bash: .bashrc or .bash_profile (exactly which one is a bit of a rabbit hole sadly)

zsh: ~/.zshrc

fish: ~/.config/fish/config.fish

(illustration of a little fish with a heart-shaped tail)

show what your shell is actually going to do when you run the program

type python3

instead of running what’s in PATH, sometimes it’ll run a builtin or alias or cached entry

show the first match on your PATH for a program

which python3

(but in zsh which acts like type)

show ALL matches on your PATH for a program, in order

which -a python3

look at your PATH

echo $PATH

show each entry on its own line

echo $PATH | tr ':' '\n'

clear the PATH cache (bash/zsh)

hash -r

why you might need to do this: bash and zsh cache PATH lookups, so sometimes updating your PATH doesn’t work properly

Saturday Morning Comics!

Want another comic like this in your email every Saturday? Sign up here!

I'll send you one of my favourite comics from my archives every Saturday.
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)