Syed Mazreena Syed Mazreena - 1 year ago 108
Bash Question

Aspect : "execution time" on the every linux command executed

Wanted to add aspect:executionTime for each linux command performed

Is there any way to add the add the default aspect environment such that have to get the executionTime for the linux command executed

Answer Source

According to the Prompting section of man bash you can use \t to include the current time in the prompt. For example:

$ PS1='\t \$ '
13:44:13 $ 

This of course does not include the time it takes to type the next command, so its utility depends on how accurate you want to be.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download