GNU date(1) understands the %N format spec, which outputs nanoseconds, so:
$ date +%H:%m:%S.%N
outputs 19:10:03.725196000
BSD date doesn't understand %N. How can I print the current time with sub-second precision on OS X?
|
GNU
outputs 19:10:03.725196000 BSD date doesn't understand %N. How can I print the current time with sub-second precision on OS X? |
|||
|
|
|
As you said, BSD However, I would not advise replacing the version that ships with your mac with the new one. Most of these coreutil programs are written such that their output can be understood by other programs, not necessarily humans. So reliability in output is a necessity. There might be several scripts in your mac that parse the output of BSD's The simplest way to do this safely on a mac is to use
The GNU equivalent will be named
|
||||
|
|