Jay Ahmed
Jay Ahmed

Reputation: 9

How to timestamp a bash command

I am pretty new to bash scripting. I am trying to do a small project where I timestamp a bash command/alias. I am trying to timestamp when I update home brew. So before I run brew update, I would like to see when I ran the command last.

Upvotes: 0

Views: 60

Answers (1)

MartinTintin3
MartinTintin3

Reputation: 38

If you run HISTTIMEFORMAT="%d/%m/%y %T " && history | grep "brew update", then it will print the date and time on the left of all the brew update commands.

Upvotes: 1

Related Questions