command not found after installing
You installed a program but the shell says "command not found": find where it went and let the shell see it.
Steps
-
hash -rmake the shell forget its old list of commands
-
ls ~/.local/bin ~/.cargo/bin ~/go/binwhere pip, cargo and go put programs
-
echo "$PATH" | tr : '\n'the folders the shell searches
-
exec "$SHELL" -lstart the shell again, reading the new settings
-
eval "$(/opt/homebrew/bin/brew shellenv)"macOS, Homebrew on Apple Silicon: add brew to this shell
-
npm prefix -gwhere npm installs global programs
Notes
- When the folder is missing from PATH, see "add a folder to the path".
Commands used
hashechobrewnpm
Each has a page in lore: lore hash opens it.
Related recipes
- check if a program is installedFind whether a command exists, where it is, and which package it came from.
- add a folder to the pathLet the shell find programs in a folder, for good, and reload the settings without logging out.
- add to the end of a fileAdd lines to a file without replacing it, also to a file only root can write.
- argument list too long"Argument list too long" from rm, cp or mv: too many files for one command line. Hand them over in batches.