Skip to main content
9 events
when toggle format what by license comment
Jul 17, 2023 at 8:09 comment added Daniel F And if you want the elapsed time in h:mm:ss-format replace -p with -f %E.
Aug 14, 2020 at 19:34 comment added Jim Paris @muffo You are spawning a new shell, so aliases will only work if the new shell you're spawning defines them too. You might find something like bash -i -c 'echo foo' to work better than sh -c 'echo foo' in that regard.
Aug 14, 2020 at 19:32 comment added Jim Paris The version shared there runs multiple commands, but does not save the time output to a file, as this question requested. If you read this question closely, you'll see that using parenthesis to make a subshell was mentioned as not a solution.
Aug 13, 2020 at 1:20 comment added BhaveshDiwan Although this answer works great, I prefer a version shared at superuser.com/a/608596/135762 because it makes the code much readable, instead of just being passed as a string to sh -c. Anyway, Can somebody please point a situation when one would be preferred over another?
Aug 10, 2020 at 20:40 comment added Muffo Is it expected that aliases won't work in the sequence of commands?
Jun 2, 2019 at 2:08 comment added Geo a shorter version: time -p sh -c 'echo "a"; echo "b"'
Aug 23, 2012 at 11:35 vote accept Karel Bílek
Aug 22, 2012 at 19:41 review Low quality posts
Aug 22, 2012 at 20:07
Aug 22, 2012 at 19:36 history answered Jim Paris CC BY-SA 3.0