←back to thread

2039 points Gadiguibou | 5 comments | | HN request time: 0s | source
Show context
shortrounddev2 ◴[] No.36493021[source]
While you're at it, `brew install coreutils`. The coreutils that ship with macOS lack a lot of features available on Linux. If you use bash, I recommend upgrading it, too, since Apple ships a 16 year old build (iirc due to legal issues associated with GPLv3) `brew install bash`
replies(3): >>36493196 #>>36493701 #>>36495525 #
lloeki ◴[] No.36493701[source]
They come from BSD (and, nitpick, are not called coreutils). These BSD tools lack features mostly only if you're used to GNU coreutils.

The expanse of GNU coreutils features is questionable too: some are nice, some you can do without easily and rarely to never miss, and some are downright annoying (yes I'm looking at you, ls with colors+quotes)

replies(1): >>36494081 #
shortrounddev2 ◴[] No.36494081[source]
Obviously everything is preference, but I prefer things like expanded regex in gnu grep to the underpowered macOS utils
replies(1): >>36494780 #
1. alwaysbeconsing ◴[] No.36494780[source]
GNU and BSD grep both default to "basic" regular expressions and both have the `-E` switch to use "extended" expressions.
replies(1): >>36494944 #
2. shortrounddev2 ◴[] No.36494944[source]
Last time I used macOS (which was 6 years ago) there was no extended expressions, or the regex syntax was limited. I forget (again, haven't used an apple product in years)
replies(1): >>36495476 #
3. alwillis ◴[] No.36495476[source]
It's not necessary to install a suite of commands if you want updated grep.

Just use Homebrew and you can install different versions of grep, including GNU's:

    brew install grep
replies(1): >>36495665 #
4. shortrounddev2 ◴[] No.36495665{3}[source]
Sure but with this you get all the other improved core utils like sed, etc. GNU utils just blow BSD/macOS out of the water. Personally, macOS seems to me like a half baked development platform in general
replies(1): >>36510036 #
5. alwillis ◴[] No.36510036{4}[source]
Some of us don't want all of GNU's utilities; just on an as-needed basis. They're not as needed as they once were.

Many of these utilities have been rewritten in Rust and have more modern features and are faster.

For example, instead of ls, I use exa [1]. Or ripgrep [2] instead of grep. sd [3] instead of sed.

[1]: https://github.com/ogham/exa

[2]: https://github.com/BurntSushi/ripgrep

[3]: https://github.com/chmln/sd