Home > Blockchain >  How to declare command path globally in mac terminal?
How to declare command path globally in mac terminal?

Time:07-08

While processing with Mac terminal, sometimes I got a message like 'something is not command'.

I think there's a way to declare path globally where I am. (Such as 'brew')

I want to add path in the list that when I 'echo $PATH'

'export Path=~/path/bin:$PATH' is defined and evaporated when I exit the terminal.

Share your knowledge to me. Thanks.

CodePudding user response:

You have the right command: export PATH=/your/custom/folder:$PATH What you're missing is to add this somewhere. If you're using bash as a shell this might be ~/.bashrc, if it's zsh something like ~/.zshrc and just append your export line to the end of the file. You can check what shell you're using with echo $SHELL.

Changes are reflected the next time you open a terminal, or just run source ~/.zshrc to update the current session.

  • Related