Syed Mazreena Syed Mazreena - 2 months ago 11
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


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.