Can I write the output of the time difference command to a file?
For example, I tried:
$ time foo.sh > bar.txt
But it only gives the output of foo.sh to bar.txt.
In many shells including
Will time both the
Will tell you the time needed to open
If you want to redirect
works as well but with
Note that both would redirect both the output of time and the errors of
Note that POSIX doesn't specify whether
Note that you can't time functions or builtins or pipelines or redirect
But that means the timing will also include the startup time of that extra
Not all versions of time support the -o and --output arguments.
You will want to run the command like this:
This will put the output of script.sh into /dev/null and the results to /tmp/logFile.
If you want both STDERR and STDOUT to go to the log file you can run it like this:
To get the output of
To get just the output of
If you use bash'