简体   繁体   中英

/usr/bin/time: No such file or directory

I'm trying to run the time command for a file on a virtual machine running Fedora 19 64-bit and I get the message "/usr/bin/time: No such file or directory". I tried googling, but it appears it's something that I should already have. How do I get this on my computer?

For those on a raspberry pi or similar debian-based distributions, I found that I could install the package time ( sudo apt install time ) to obtain access to the time command.

Edit: For Fedora-based systems, the package name might be different. Try a dnf search time , followed by a sudo dnf install {package_name} . I don't have a Fedora machine immediately to hand to get the exact package name from.

bash/zsh/modern shells usually implement a basic time command as a builtin. So it won't exist on the filesystem, but time mycommand should work.

If you want the "proper" time command (with more options eg: -l / -v ), then you'll need to install it via apt/yum/etc. You'll need to run it as /usr/bin/time mycommand so the shell-builtin doesn't get invoked.

It might be in other locations. I'd start by typing:

which time

This command will give you the path to time, if it's anywhere in your path.

If you need to build it yourself, you can get the source here:

http://directory.fsf.org/wiki/Time

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM