以下の内容はhttps://blog-smatsuzaki.hatenablog.com/entry/2025/05/30/182526より取得しました。


Linuxで、historyの実行結果にtimestampを付与したい。

環境変数 HISTTIMEFORMAT.bashrc に設定することで、次回のログイン以降より history の実行結果にtimestampが付与される。

$ echo 'export HISTTIMEFORMAT="%F %T "' >> ~/.bashrc

参考

If the HISTTIMEFORMAT variable is set and not null, its value is used
as a format string for strftime(3) to print the time stamp associated
with each displayed history entry.  No time stamps are printed otherwise.

(訳) HISTTIMEFORMAT 変数が設定されており、かつ空でない場合、その値は strftime(3) の書式文字列として使用され、表示される各ヒストリ(履歴)エントリに関連付けられたタイムスタンプが出力されます。それ以外の場合は、タイムスタンプは表示されません。

https://linuxcommand.org/lc3_man_pages/historyh.html



以上の内容はhttps://blog-smatsuzaki.hatenablog.com/entry/2025/05/30/182526より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14