How can I append the date/time stamp to commands in history?
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
In bash 3.0 and newer you can define an environment variable called HISTTIMEFORMAT and put its value to a time format, using the time specification of the command date. Once you have defined this variable (you can put the definition in your ~/.bashrc) the history will be timestamped. For example