56

I do brew search date unsuccessfully. I have coreutils in my system. I could not find GNU date anywhere.


How can you have GNU date in OS X?

0

1 Answer 1

81

The gdate binary from coreutils should be the gnu date program:

$ gdate --version date (GNU coreutils) 8.25 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David MacKenzie. 

If you don't have that in the path, perhaps brew rm coreutils && brew install coreutils would be a place to start as well as inspecting your $PATH

1
  • 13
    ...if you have to run scripts which require GNU tools (e.g. MXE make process, which will stumble when using Apple date), you can temporarily modify your shell with PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH". In that directory, a symbolic link to gdate without the "g" prefix will be provided. Commented Nov 16, 2022 at 17:45

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.