3

I read the man pages and the '-v' option(short for --verbose) is there and I'm sure this should work:

 time -v ls 

However, the output is:

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

I typed the command according to the man pages in the order of 'time argument(s) command'. I can't see where I made a mistake here.

8

In bash:

$ type -a time
time is a shell keyword
time is /usr/bin/time

You called time, cause bash invoked time built in keyword instead of external /usr/bin/time command. time built in keyword does not have option -v. bash interpreted that you calling built in time on command -v, causing this error.

Try:

/usr/bin/time -v ls

or:

command time -v ls
  • @JechtTyre As far as I'm concerned, I get a valid, satisfying result in both cases. What do you mean by "the second doesn't [work]"? Do you get an error? Unexpected behaviour? – John WH Smith Oct 15 '14 at 18:30
  • My bad. Both your commands are correct. – Jecht Tyre Oct 15 '14 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.