[英]/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".我正在尝试在运行 Fedora 19 64 位的虚拟机上运行文件的时间命令,我收到消息“/usr/bin/time:没有这样的文件或目录”。 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.对于使用 raspberry pi 或类似基于 debian 的发行版的用户,我发现我可以安装包
time
( sudo apt install time
) 以获取对time
命令的访问权限。
Edit: For Fedora-based systems, the package name might be different.编辑:对于基于 Fedora 的系统,软件包名称可能不同。 Try a
dnf search time
, followed by a sudo dnf install {package_name}
.尝试
dnf search time
,然后是sudo dnf install {package_name}
。 I don't have a Fedora machine immediately to hand to get the exact package name from.我没有立即可用的 Fedora 机器来获取确切的软件包名称。
bash/zsh/modern shells usually implement a basic time
command as a builtin. bash/zsh/现代 shell 通常将基本
time
命令实现为内置命令。 So it won't exist on the filesystem, but time mycommand
should work.所以它不会存在于文件系统中,但是
time mycommand
应该可以工作。
If you want the "proper" time command (with more options eg: -l
/ -v
), then you'll need to install it via apt/yum/etc.如果您想要“正确”的时间命令(带有更多选项,例如:
-l
/ -v
),那么您需要通过 apt/yum/etc 安装它。 You'll need to run it as /usr/bin/time mycommand
so the shell-builtin doesn't get invoked.您需要将它作为
/usr/bin/time mycommand
以便不会调用 shell-builtin。
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 http://directory.fsf.org/wiki/Time
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.