Install Homebrew
First, visit Homebrew homepage and follow the installation instructions to install Homebrew.git
Shortcut: install the latest XCode and then run the following command to install:github
1. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then add the following line to your .bashrc or .zshrc:vim
2. export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
Install the GNU Command Line Tools
First comes the most important one — GNU Coreutils:xcode
3. brew install coreutils
GNU Coreutils contains the most essential UNIX commands, such as ls, cat.ruby
Then you may probably want to install the following ones (For some of the packages, you need to run brew tap homebrew/dupes first, but only once for your system):bash
brew install binutils brew install diffutils brew install ed --with-default-names brew install findutils --with-default-names brew install gawk brew install gnu-indent --with-default-names 4. brew install gnu-sed --with-default-names brew install gnu-tar --with-default-names brew install gnu-which --with-default-names brew install gnutls brew install grep --with-default-names brew install gzip brew install screen brew install watch brew install wdiff --with-gettext brew install wget
下面是mac已經默認安裝,想要替換成最新版本的能夠本身去安裝
brew install bash brew install emacs brew install gdb # gdb requires further actions to make it work. See `brew info gdb`. brew install gpatch brew install less brew install m4 brew install make brew install nano
你也許須要下面的安裝。
brew install git brew install openssh brew install perl brew install python brew install rsync brew install svn brew install unzip brew install vim --override-system-vi brew install macvim --override-system-vim --custom-system-icons brew install zsh