49

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?

1 Answers1

69

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

bmike
  • 235,889
  • 6
    ...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. – jvb Nov 16 '22 at 17:45