Why do bash history files save timestamps in Unix (Epoch) time?

Solution Verified - Updated -


  • When the HISTTIMEFORMAT environment variable is set in any way (for example: HISTTIMEFORMAT="[%F %T] "), bash stores timestamps for each history item and when a user inspects history with the BASH built-in history, the timestamps are shown in an easily-readable format (ex: 2013-01-29 11:40:19); however, when these history sessions are saved out to a file (e.g., ~/.bash_history), the timestamps are shown in Unix time (seconds since the Epoch). Why? How can these be read without using su to switch over to the user?


  • Red Hat Enterprise Linux

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content