Skip to content

zsh – How to get version of `/usr/bin/time` command on macOS?

  • by

If you ask which time you get time: shell reserved word. It is documented in the man page for your shell e.g.

% man zshmisc
 time [ pipeline ]
              The pipeline is executed, and timing statistics are reported on the standard error in the form specified by the TIMEFMT parameter.  If
              pipeline is omitted, print statistics about the shell process and its children.

man time specifically references /usr/bin/time in the text. So it’s fair to assume that’s how the docs match up.

Using /usr/bin/time options with the builtin throws errors, so I’m not sure if they are identical. If you need the options, use /usr/bin/time explicitly.

As to the versions, I would suggest the builtin version is that of the shell, and /usr/bin/time corresponds to your macOS version for the lack of any -v option.

Leave a Reply

Your email address will not be published. Required fields are marked *