加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – Gnu时间和格式输出

发布时间:2020-12-13 19:42:51 所属栏目:Linux 来源:网络整理
导读:我想使用gnu时间来衡量一些小程序的运行时间.在这个人中,它写成: -f FORMAT,--format FORMATUse FORMAT as the format string that controls the output of time. See the below more information. 然后在例子中我们有: To run the command `ls -Fs' and s
我想使用gnu时间来衡量一些小程序的运行时间.在这个人中,它写成:
-f FORMAT,--format FORMAT
Use FORMAT as the format string that controls the output of time.  See the below more information.

然后在例子中我们有:

To run the command `ls -Fs' and show just the user,system,and total time:
time -f "%E real,%U user,%S sys" ls -Fs

但是当我尝试从示例中发出这个命令时,我得到:

time -f '%E real,%S sys' ls -Fs
-f: command not found

real    0m0.134s
user    0m0.084s
sys     0m0.044s

我想知道问题在哪里,我在哪里犯错?我只想显示用户时间,这就是为什么我用时间输出格式来玩.

解决方法

Bash为一个有一个shell内置命名时间.通过它的一种方式是键入/usr/bin/time.另一种方式是alias time = /usr/bin/time.另一方面,bash内置的环境变量TIMEFORMAT.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读