I have been trying to run the usr/bin/time
command in my terminal (Bash) with the verbose flag --verbose
or -v
but have repeatedly been getting this error:
/usr/bin/time: illegal option -- v
usage: time [-lp] command.
The command I have been running looks like basically like this:
/usr/bin/time -v python practice.py
Any ideas how to get this to work properly on a Mac? (I have OS X Yosemite)?
If you have homebrew, you can get GNU time
by installing the gnu-time
package:
brew install gnu-time
After that, it’s available as the gtime
command:
$ gtime
Usage: gtime [-apvV] [-f format] [-o file] [--append] [--verbose]
[--portability] [--format=format] [--output=file] [--version]
[--help] command [arg...]
The case is similar for a lot of other homebrew-packaged GNU utilities for OSX; e.g., you can get the GNU df
command with gdf
, du
with gdu
, readlink
with greadlink
, etc.
The homebrew package that has most of those is coreutils
, which installs about a hundred different GNU-flavored commands. Other useful packages: findutils
, gnu-sed
, gnu-tar
.
If you don’t have homebrew installed yet, you can get it with just a single command:
Command to download and install homebrewruby -e "$(curl -fsSL\
https://raw.githubusercontent.com/Homebrew/install/master/install)"
I think looking at the man page the verbose flag is GNU only. Unfortunately, OSX implementation simply differs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With