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!
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
- figure out what directory you need to add (try
find / -name ffmpeg
if you can’t figure it out) - edit your shell config
- 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/config.fish
Saturday Morning Comics!
Want another comic like this in your email every Saturday? Sign up here!