Hacker News new | ask | show | jobs
by idsout 1693 days ago
> little bsd differences have been driving me nuts since I took a job that forced me into a MacBook, but these tools solve that issue and are easy to install with Homebrew.

I'm in the same boat as you - I love the the rust-based CLI tools. I would also recommend installing the GNU coreutils via homebrew (https://formulae.brew.sh/formula/coreutils). This lets you run the GNU coreutils by prefixing them with a `g`, like `gsed` rather than `sed`.

2 comments

There’s a way also to remap the gnu coreutils to their normal commands without the g prefix. I did it a while ago but I can’t recall exactly how…
Brew will tell you how when you install the package.
Oh that's neat, thanks. Given you also use the rust tools, where do you find yourself reaching for the g* tools?
I use the gnu coreutils because small things like cli flags are different for the macos implementations. So for example some aliases in my .zshrc didn’t work on my MacBook. I come from a Linux background so it was nice for me to have coreutils behave exactly how I’m used to. Some people prefer gnu software for ideological reasons too.

It was one of the flags for ‘ls’ in particular that made me switch. There’s a way to add the gnu coreutils to your path without the g prefix so I never even notice the difference.

Not GP, but I'd imagine one use case would be for writing scripts to be used on other machines where the tools might not be installed, e.g. writing scripts on a mac to be run on Linux servers. If for example you want to script something for CI to be run on a Linux server, I can imagine having the GNU utilities in the default path on a Mac would be useful, since getting the Rust tools installed on the CI server is probably not worth the effort.
Mainly find and sed due to muscle memory, but I've been using fd and sd more and more lately.
it's all about the flags, e.g. readlink -f
gsed -i, Make, AWK, Tar