0

macOS 10.15 comes with a very old version of the diff command. I've read in https://unix.stackexchange.com/a/338960/80391 that version 3.4 contains the --color argument.

How can I update the version on macOS so that I can use this newer feature?

1
  • 1
    You'll have build it from source and add it to your environment. You can get the source code here: ftp.gnu.org/gnu/diffutils Commented Jun 6, 2020 at 21:51

1 Answer 1

5

Since macOS does not include a package manager, you have to install one if you want newer versions of the tools that come with the OS. The most popular one these days is Homebrew. Macports is a similar project.

After installing Homebrew, you can install a newer version of diff by installing the diffutils package:

brew install diffutils

Of course you can also build everything from source, but using a package manager is easier.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.