29

I want to get a bit more information than the standard time command gives, so I want to pass the verbose flag. info time gives as example time -v sleep 4, however when I execute that (both in bash or tcsh) I get

% time -v sleep 4
-v: Command not found.
0.000u 0.000s 0:00.00 0.0%  0+0k 0+0io 0pf+0w

What am I doing wrong?

Dennis Williamson
  • 106,229
  • 19
  • 167
  • 187
Peter Smit
  • 9,346
  • 13
  • 45
  • 45

1 Answers1

50

If you execute time then (even though which time will claim otherwise...) you execute the time command of the shell. That version does not accept -v. Instead, execute the proper time executable: [source]

$ /usr/bin/time -v sleep 4

That will work.

Stephan202
  • 7,046
  • 3
  • 24
  • 15