I'm trying to run linux scripts on the mac, but even brew's updated base64 doesn't support -w0. I want something close to base64 (GNU coreutils) 8.22

Instead of base64 1.5 from brew or the unknown version MacOs ships with whose binary's md5 is 718fe34e4012999c180f807fe323e7f1

I've had great luck by using iTerm and loading .bashrc to replace most bsd/mac utilities with gnu ones.

P.S. There is little reason to install the one from brew, as it line breaks by default and has no way to disable that "feature".


2 Answers 2



Brew does have the gnu version in the coreutils package. It installs it as gbase64


(I don't have the points to add a simple comment to @ray-foss answer)

Given that my PATH has /opt/homebrew/bin, I symlinked over the brew base64, so both are available, in case the other might be needed, if ever.

brew install coreutils
sudo ln -s /opt/homebrew/bin/gbase64 /opt/homebrew/bin/base64

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .