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?
3 Answers
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.
-
1On my Ubuntu machine I was able to install time only after running
sudo apt-get update
– AnatolyOct 14, 2019 at 9:53
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:
-
I downloaded it and followed the instructions in the INSTALL file, but I got an error: "/usr/bin/install: cannot create regular file 'usr/local/bin/time': Permission denied make: *** [install-binPrograms] Error 1" I also tried running the "which time" command, but the output was "which: no time in " followed by a directory in parenthesis. Nov 29, 2013 at 4:13
-
Your system administrator seems to have blocked you from installing. Install with sudo if you can. Otherwise, you're going to need to contact your sysadmin to give you permissions to do this.– russellmNov 29, 2013 at 4:21
-
1But, would it be the same than
/usr/bin/time
? Referencing this answer to one of my questions, at least in Debian-based distros,/usr/bin/time
is not exactly the same than thetime
available in environment PATH...– SebasSBMMar 20, 2019 at 7:56