Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 1
    time will give you most of what you need but I'm not sure how to add it automatically. Commented Nov 19, 2013 at 17:41
  • That was my first thought as well. It's nice to be in good company! Commented Nov 19, 2013 at 17:48
  • I think that for the "end time" PROMPT_COMMAND can be used... Commented Nov 19, 2013 at 17:54
  • Related: unix.stackexchange.com/a/44723/22222, stackoverflow.com/a/1177511/1081936. Combining those with @Braiam's PROMPT_COMMAND suggestion should be possible but I don't have time to play with it now. Commented Nov 19, 2013 at 18:06
  • you could edit your PS1 to display the $(date), and also use PROMPT_COMMAND to display another $(date) once the command finished. The problem though is that your prompt will only show the time the prompt appeared, not the time when you started the command. However, you just have to remember to press "Enter" one time before typing the important(/long) commands, to get a fresh starting time ... Commented Nov 19, 2013 at 18:07