
This is a page from an upcoming zine called "The Secret Rules of the Terminal".
To get an email when the zine comes out, sign up for the zine announcements list!

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!