blog » Linux / Mac/iPhone/iPad » MAC下下如何查看环境变量

MAC下下如何查看环境变量

查看所有的变量:

$ printenv
PATH=/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/calios/.cabal/bin:/Applications/ghc-7.8.4.app/Contents/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/calios/.cabal/bin:/Applications/ghc-7.8.4.app/Contents/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/calios/.cabal/bin:/Applications/ghc-7.8.4.app/Contents/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
ZSH=/Users/calios/.oh-my-zsh

查看指定的变量:

$ echo $SHELL
/bin/zsh

设置临时环境变量

$ export PATH=$PATH:~/bin

后面的$PATH意味着在原有值的基础上,拼接上~/bin/,再将新值赋给PATH。

This post has already been read 13 times!

Related posts

RSS 2.0 | leave a response | trackback

发表评论