Skip to Content

A stick figure smiling

Here's a preview from my zine, misc! 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!

PATH is what causes “command not found” errors

$ ffmpeg
zsh: command not found: ffmpeg

sad person (thinking): “but why?? I just installed ffmpeg!”

your shell has a list of directories it looks for commands in

bash (thinking): “I’ll check /usr/local/bin then /usr/bin then /opt/local/bin then …”

That list is in an environment variable called PATH

how to check which shell you’re using

To change your PATH, you need to know which shell you’re using.

To check, run a nonexistent command:

$ zxasdfasfaewfhrasda
zsh: command not found: ...

tada! your shell is zsh!

how to see your current PATH

$ echo $PATH

Or to format it more nicely in bash or zsh:

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

how to fix your PATH

  1. figure out what directory you need to add (try find / -name ffmpeg if you can’t figure it out)
  2. edit your shell config
  3. open a new terminal (very important!)

how to edit your shell config

You’ll need to add one line. The file you edit depends on your shell:

for bash: add export PATH=$PATH:/some/dir to ~/.bashrc

for zsh: add export PATH=$PATH:/some/dir to ~/.zshrc

for fish: add set PATH $PATH /some/dir to ~/.config/fish/

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)