man time
shows it has some options, like this, to write just the time
output to a file instead of to stderr
:
-o FILE, --output=FILE
So, I try to use it
$ time -o out.txt ls
-o: command not found
real 0m0.081s
user 0m0.070s
sys 0m0.012s
This does not work! It says -o: command not found
.
To prove out.txt
doesn't exist:
$ cat out.txt
cat: out.txt: No such file or directory
What am I doing wrong?
How can I use options like -o somefile.txt
with time
?
I am on Linux Ubuntu 18.04, using bash
as my terminal.
time -a -o log emacs bork
– Roel Van de Paar Apr 21 '22 at 01:01command time
or/usr/bin/time
see also: https://unix.stackexchange.com/a/10747/216907 – thanasisp Apr 21 '22 at 01:02