打印環境變量:echo $PATH設置環境變量:export PATH=$PATH:/usr/local/git/bin
應用:在git-scm下載git2.0.1版本,圖形安裝後,直接在終端敲giv --version提示-bash comman nof found. echo $PATH發現沒有/usr/local/git/bin這個環境變量,因而把這邊環境變量加進去就行了.git
wget
mac默認沒安裝,因此須要下載源文件http://ftp.gnu.org/gnu/wget/wget-1.13.4.tar.gz安裝;
tar zxvf wget-1.13.4.tar.gz
./configure --with-ssl=openssl && make && sudo make install
備註:必需要加--with-ssl=openssl。且安裝Command Line Tools.xcode
port
相似yum ,apt-get。
mac默認沒有安裝,下載:https://distfiles.macports.org/MacPorts/MacPorts-2.3.1.tar.gz,
./configure && make && sudo make install.
添加環境變量:export PATH=$PATH:/opt/local/bin:/opt/local/sbin
更新port index:sudo port -v selfupdate
列出全部可安裝的軟件包:port list
備註:必須安裝Command Line Tools.且port版本和xcode版本還有系統版本要對應(詳情參考marports.org官網)。
參考:blog.csdn.net/lynjay/article/details/7936470bash