2010-02-08-history-command-with-time-stamp.md 604 Bytes
Newer Older
Danesh Manoharan's avatar
Danesh Manoharan committed
1
2
---
title: History command with time stamp
3
author: Danesh Manoharan
Danesh Manoharan's avatar
Danesh Manoharan committed
4
5
6
7
8
9
10
date: 2010-02-08T05:44:23+00:00
pvc_views:
  - 5967
dsq_thread_id:
  - 889819319

---
11
Running the ' history ' command only gives you line numbers. Sometimes it's useful to have a time stamp attached to each command to build a clearer picture.
Danesh Manoharan's avatar
Danesh Manoharan committed
12

13
Simply set the " HISTTIMEFORMAT " env variable to enable time stamps in ' history '.
Danesh Manoharan's avatar
Danesh Manoharan committed
14
15
16
17
18
19
20

Run the command below.

`export HISTTIMEFORMAT=' %F %T '`

Before:

Danesh Manoharan's avatar
Danesh Manoharan committed
21
![](/wp-content/uploads/2010/02/history.timestamp.1-450x393.png)
Danesh Manoharan's avatar
Danesh Manoharan committed
22
23
24

After:

Danesh Manoharan's avatar
Danesh Manoharan committed
25
![](/wp-content/uploads/2010/02/history.timestamp.2-450x393.png)