View Full Version : errors running the time command with non-default formatting in Fedora core 6

2nd January 2007, 02:00 PM

I am having problems running the following:

time -f "\t%E real,\t%U user,\t%S sys" ls -Fs

bash: -f: command not found

real 0m0.001s
user 0m0.000s
sys 0m0.000s

which is one of the examples in:

when I type man time in my fedora core 6, I don't see the same example, or any, but I see that I can use it this way generally,
The time command version that I have is:

I searched for a newer one, and couldn't find any for fedora

and my system is:
Linux localhost.localdomain 2.6.18-1.2868.fc6xen #1 SMP Fri Dec 15 18:20:31 EST 2006 i686 i686 i386 GNU/Linux

I really need to get different resources not just the default,

I appreciate your help a lot,

thank you,


2nd January 2007, 02:06 PM
"time" is a bash builtin command, and has the precedence over the time program. To use this latter, type the full path /usr/bin/time

3rd January 2007, 12:44 AM

Thank you very much for replying,

I did, and I had a permission problem that doesn't really matter, but would be nice to see how to solve it as well:
I am running:

/usr/bin/time -f "\t%E \t%U \t%S \t%M" source runmm.sh Results/7/

/usr/bin/time: cannot run source: No such file or directory
Command exited with non-zero status 127
0:00.00 0.00 0.00 0

then what worked with me:

/usr/bin/time -f "\t%E \t%U \t%S \t%M" ./runmm.sh

however, this script runs 2 different programs one after another, and I need to measure as well the memory resources by these programs, not by the running script, the time measure is good here, but not the memory

So I copied the time command inside the script, which runs an mpi job, so it measures zero for memory again, and I assumed this is the memory consumed by the mpirun command itself and not by the distributed program,

/usr/bin/time -f '\t%E \t%U \t%S \t%M' mpirun -np 5 ./my_Dist_prog My_Args

I copied the time command after the mpirun command, and the results were even better, it measures the resources for each process, however, with zero memory for all again,

mpirun -np 5 /usr/bin/time -f '\t%E \t%U \t%S \t%M' ./my_Dist_prog My_Args
0:03.90 0.00 0.00 0
0:03.91 0.23 0.38 0
0:03.90 0.40 0.34 0
0:03.91 0.30 0.44 0
0:03.91 0.46 0.56 0

I tried other memory measures, and all returned zero for all processes:

\t%M \t%t \t%K \t%D \t%p \t%X

same problem happened with the I/O measures, they all return zero, while these processes do extensive disk writing as they go,

Sorry for the detailed response, but I really need to measure accuratly the resources consumed by these processes, but no way this can be accurate results,

I appreciate your help,