Featured image of post Mac OS environment variable settings

Mac OS environment variable settings

View file contents

cat ~/.zshrc

If the file does not exist, or if it exists, enter the editing state directly

nano ~/.zshrc

Type i to start editing the file, add the following to the file and save

source ~/.bash_profile


List environment variables

printenv

List Paths under environment variables

echo $PATH

open bash profile

nano ~/.bash_profile

Add path to PATH

1
export PATH=$PATH: path name

or

1
PATH=$PATH: path name

Execute bash profile

1
source ~/.bash_profile
Built with Hugo
Theme Stack designed by Jimmy