How can I give arguments to time command (ubuntu)

21

4

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?

Peter Smit

Posted 2010-02-23T10:40:34.157

Reputation: 7 906

Answers

40

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

Posted 2010-02-23T10:40:34.157

Reputation: 5 946