I would like to know how long a command that I entered into my terminal has been running. It would be great to be able to get the timestamp of every command in my history. Let me know if you need any more information in order to be able to answer this question. Thanks.
EDIT: I am using a bash terminal.
Here's how: Open Start. Search for Command Prompt, and click the top result to open the console. Type the following command to view the command history and press Enter: doskey /history.
To enable timestamp in Bash history in Linux, you need to set the HISTTIMEFORMAT environment variable. This variable is used to print the timestamp associated with each displayed history entry. Here, the %F option is used to display the date in YYYY-MM-D D (Year-Month-Date) format.
To view your entire Terminal history, type the word “history” into the Terminal window, and then press the 'Enter' key. The Terminal will now update to display all the commands it has on record.
Assuming you are using command prompt
HISTTIMEFORMAT="%d/%m/%y %T "
then
history
http://www.cyberciti.biz/faq/unix-linux-bash-history-display-date-time/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With