[20140627]time使用.txt

[20140627]time使用.txt

$ type -a time
time is a shell keyword
time is /usr/bin/time

--可以发现time有两个命令,1个是内置的,一个是外置的.

如果:

$ time  ls -l /etc/passwd
-rw-r--r--  1 root root 2874 2012-05-15 11:34:26 /etc/passwd

real    0m0.003s
user    0m0.001s
sys     0m0.002s

--如果要使用外部命令,可以使用:
$ /usr/bin/time -v ls -l /etc/passwd
-rw-r--r--  1 root root 2874 May 15  2012 /etc/passwd
        Command being timed: "ls -l /etc/passwd"
        User time (seconds): 0.00
        System time (seconds): 0.00
        Percent of CPU this job got: 50%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 0
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 252
        Voluntary context switches: 2
        Involuntary context switches: 1
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0

也可以使用如下:

\time -v ls -l /etc/passwd

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-1195739/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/267265/viewspace-1195739/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值