Mac OS X Install the gun command line tool

Source: Internet
Author: User
Tags install homebrew


Many of MacOS's users are it-related people, and Unix-like systems bring many aspects, especially those who deal with Linux often. But as people who frequently use the Linux command line find that many of the command-line tools in MacOS are BSD tools, which are quite different from how Linux is used, how do you install the gun command-line tool and then switch between MacOS and Linux more comfortably? Then found the following article, incidentally translated.


Original address: Install and use the GNU Command line Tools on Mac OS X | Hong Xu



If you are a user migrating from Linux to a Mac OS X system, you may find that the command-line tools preinstalled on Mac OS are not as powerful and useful as Linux (note: Of course, for users accustomed to Linux). The reason is that Max OS x is using the BSD version of the command-line tool, which is somewhat different from the Linux version, but they all follow the POSIX standard. But we can install the GNU program through the HomeBrew aspect and set them as the default tool.


Installing Homebrew


First, visit Homebrew's official website and install Homebrew according to the installation tutorial.



Simply put: Install the latest Xcode and then execute the following command at the command line to install


-e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


Then add the following configuration to your.bashrcor.zshrc


export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"


Note: I believe most users have installed this handy tool.



To make it easy to find the man for the command,/etc/man.confadd a configuration to the file


MANPATH_MAP /usr/local/opt/coreutils/libexec/gnubin /usr/local/opt/coreutils/libexec/gnuman
Installing the GUN command line tool


First installation is the most important one – GUN coreutils


install coreutils


GUN CoreutilsContains a lot of basic UNIX commands, likelscat



Then you may want to install the following software (for some packages, you need to do it firstbrew tap homebrew/dupes, but just do it once)


brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
brew install gawk
brew install gnu-indent --with-default-names
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


-- default-namesThe option prevents Homebrew from pre-adding GS to the newly installed command, so that we can use these commands by default, overwriting the commands preinstalled by OS X.



Some commands already exist on Mac OS X, but you want a new version


 
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 m4
brew install make
brew install nano


Here is a supplemental software, they are not from the gun, but you can also install a new version to replace the original version of Maxos.


 
brew install file-formula
brew install git
brew install less
brew install openssh
brew install perl518   # must run "brew tap homebrew/versions" first!
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


Now your OS X should have a very simple command line, happy to use it.


Statement:
This article is from the "Orangleliu Notebook" blog, reproduced please be sure to keep this source http://blog.csdn.net/orangleliu/article/details/47357339 author Orangleliu knowledge sharing Attribution-Share the 3.0 protocol in the same way


Mac OS X Install the gun command line tool


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.