16

What's binary that will give exact result for Linux's time command flags?

alias tcmd='/usr/bin/time \-f\ "CPU: %Us\tReal: %es\tRAM: %MKB"'

Current time in Mac OSX for command above is:

/usr/bin/time: illegal option -- f
usage: time [-lp] command.
2
  • Why not set the TIMEFORMAT variable and use bash's builtin time.
    – fd0
    Apr 19 '16 at 11:01
  • I've tried export TIMEFORMAT="CPU: %Us\tReal: %Es\tRAM: %MKB" but it shows -bash: TIMEFORMAT: 'M': invalid format character
    – Kokizzu
    Apr 19 '16 at 11:32
34

Nevermind, found it:

brew install gnu-time

the command is gtime

2
  • 2
    Great! Please mark this as solved.
    – JMY1000
    Apr 19 '16 at 3:47
  • 1
    Awesome, added this to my list of fresh install items for any new Mac OS Jan 30 '20 at 20:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .