Hacker News new | past | comments | ask | show | jobs | submit login

All these neat tricks being discussed, and meanwhile I just `date; my_cmd; date` for jobs I want start/end times of. The fact that I can do it with no configuration on all the umpteen boxes I log into is the reason I stick with it.



Most of the time I needed to know when I ran a command, I didn't know I would need it at the time I ran


I have this in my "~/.inputrc":

".,d": "\C-adate; \C-e; date\n"

Whenever I want a command dated like in your suggestion, instead of pressing Enter to execute the command, I press the key-sequence ".,d" and the command gets wrapped in 'date' calls.


or, if you're only interested in the time it took for the command to run:

    time my_cmd


All of those are only useful if you thought of it beforehand. Which is rare in my experience, often I want to know the time exactly when something unexpected happened.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: