Besides brew install coreutils, you may also need to install some other packages, such as gnu-sed, grep:
brew install findutils --with-default-names
brew install gnu-indent --with-default-names
brew install gnu-sed --with-default-names
brew install gnutls
brew install grep --with-default-names
brew install gnu-tar --with-default-names
brew install gawk
TheNote that the --with-default-names option is optionalremoved since January 2019, turn on this if you really needso each binary has to use these GNU commands as default ones, orbe added to the path if they willare to be compiled with aused without the g prefix.
ReferenceOld reference (when --with-default-names was available): http://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/