Is there a way to run all commands in bash as if they were invoked with time in front? I want that I could type $ some_command and this will actually invoke $ time some_command.

  • Not very well superuser.com/questions/175799/…. Perhaps zsh… – msw Sep 23 '13 at 12:04
  • zsh with the grml zsh config does this by default. It shows the time only if it exceeds a certain value. – jofel Sep 23 '13 at 12:13
  • 1
    @jofel. Actually, with zsh, it's just a matter of REPORTTIME=0 (report time of those processes that take more than 0 seconds). – Stéphane Chazelas Sep 23 '13 at 12:32
  • I am looking for an answer using bash. I don't think I'll change my shell just because of this feature. – Dror Sep 23 '13 at 19:15
  • There are other reasons to change your shell. – Gilles 'SO- stop being evil' Sep 23 '13 at 20:50

Itself time command do it :

time ls
time gimp

But if you want to invoke time for each command, you can customize a script for yourself, you should run everything with it but it's not good way.

  • My question is exactly how this script should look like... It would be really nice to be able to turn on and off this script. – Dror Sep 23 '13 at 15:53
  • I think Stephane Chazelas answer better than me... – PersianGulf Sep 23 '13 at 19:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.