103
rated 0 times
[
103]
[
0]
/ answers: 1 / hits: 120736
/ 3 Years ago, sat, may 15, 2021, 8:31:28
I was wondering if it was possible to add timestamps to terminal prompts, and if so, how could I achieve this?
More From » bash
I was wondering if it was possible to add timestamps to terminal prompts, and if so, how could I achieve this?
Add this line to the ~/.bashrc
file:
export PROMPT_COMMAND="echo -n [$(date +%H:%M:%S)] "
So the output will be something like:
[07:00:31] user@name:~$