Monday, June 24, 2013

Time command

Is there a way to only retrive the "real" time from the following? 
[root@home test]# time ls -al | tail -1 
-rw-r--r-- 1 root root 1094264 Dec 4 11:00 tests 
real 0m0.009s 
user 0m0.001s 
sys 0m0.008s 
"Tail" and "head" does not work on the that command
Use this way: 
( time -p ls -al /usr/bin )2>&1|grep real 

time is a builtin command also you can find under /usr/bin 
see example below: 
/usr/bin/time -p ls -al 2>&1 | grep real 
output will be: 
real 0.54
what I the relation between problem with time command and your squid problem? 
Why you people do not learn the rules of online communications.? 
Thanks for the replies on this. It works. However, is it possible to get the time command to generate a response with 3 decimal versus two. It provides a more accurate response. 

[root@lolin01 ~]# ( time -p ls -al /usr/bin )2>&1|grep real 
-rwxr-xr-x 1 root root 279 Sep 10 2005 kio_media_realfolder 
real 0.04 

Use this way: 
( time -p ls -al /usr/bin )2>&1|grep real 


Post a Comment

Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM