Skip to Content
Navigation:

A stick figure smiling

Here's a preview from my zine, The Secret Rules of the Terminal! 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". get the zine!
read the transcript!

PATH is how your shell knows where to find programs

It’s a list of directories that your shell searches in order.

smiling stick figure: $ python3

shell, represented by a nautilus shell: PATH=/bin:/home/bork/bin:/usr/bin (directories are separated by colons)

shell:

  1. /bin/python3? nope, doesn’t exist
  2. /home/bork/bin/python3? nope, doesn’t exist
  3. usr/bin/python3? there it is!!! run that!

how to add a program to your PATH

  1. find the directory the program is in
  2. update PATH in your config with that directory
  3. restart your shell

for WAY TOO MUCH info about how to do this, see https://wzrd.page/path

…but which directory was the program installed in?

remember how you installed it:

little stick figure with curly hair, thinking: hmm, I used the Rust installer, where does that install things?

… or do a brute force search: find / -name python3 | grep bin

(usually I put a 2>/dev/nu11 too)

PATH ordering drama

little stick figure with curly hair, thinking: ugh, no, don’t run THAT python3, run the other one!

You can prioritize a directory by adding it to the beginning of your PATH

gotcha: not everything uses your PATH

cron jobs usually have a very basic PATH, maybe just /bin and /usr/bin

In a cron job I’ll use the absolute path /home/bork/bin/someprogram

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 2025 | All rights reserved (see the FAQ for notes about licensing)