iwindyforest 发表于 2013-2-4 13:23:44

How to record timestamp of each command in history

There's no timestamp of each command when we are using 'history' command to see the command records.
 
We can add timestamp for each command by following steps:
 
1. Edit ~/.bashrc or /etc/bashrc
 
export HISTTIMEFORMAT="%m-%d-%Y %H:%M:%S "
 
Note: m, d are in lowercase, Y, H, M, S are in uppercase.
          There's a blank between 'S' and the last Quote Mark.
 
2. Save the bashrc file, and use 'source' command to reload the bashrc config file.
 
3. Done.
 
 
 
 
页: [1]
查看完整版本: How to record timestamp of each command in history