Thursday, 24 May 2012
 Home arrow Articles arrow linux arrow Adding Date And Time To Your Bash History
   
Main Menu
Home
News
Blog
Links
Search
FAQs
Spider
Articles
@intrenet
Free Softwares
Break for fun
Friends VIdeos
Techno videos
Contact Us
Disclaimer
Guest Book
Speed test
V.E.C. Calculator
IPv4 Subnet Calc
IPv6 Subnet Calc
Byte Converter
Converter
GMT/UTC Time
Bandwidth Calc
Allinone Calc
IANA Port Numbers
Country Call Codes
Pk Postal Codes
Surf Anonumously
Visitors Counter
mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday189
mod_vvisit_counterYesterday302
mod_vvisit_counterThis week751
mod_vvisit_counterThis month5300
mod_vvisit_counterAll125976
 
 
 
 


Adding Date And Time To Your Bash History PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Amanatullah khalil   
Monday, 15 June 2009

Adding Date And Time To Your Bash History

 

This is a quick but handy addon (RedHat/CentOS) to enhance your bash history (bash > 3.0).

It comes in handy particularly if there are multiple people maintaining a given server (so you can see when a command was performed) or even if you are the sole maintainer, but can't remember exactly when you did or changed something.

Edit your /etc/bashrc and append to the bottom:

export HISTTIMEFORMAT="%h/%d - %H:%M:%S "

From next login instead of:

574  tail -f /var/log/maillog
575  mailq | tail -15
576  tail -f /var/log/maillog
577  less /var/log/maillog

you get:

1002  Apr/30 - 11:46:16 grep duncan /var/log/maillog
1003  Apr/30 - 14:17:40 passwd jduncan
1004  Apr/30 - 14:18:02 smbpasswd jduncan
1005  Apr/30 - 14:50:28 history 10

Hope this helps someone;)

Thans to http://www.howtoforge.com/adding-date-and-time-to-your-bash-history

 
< Prev   Next >
 
 
 
csatpk Newsflash
Statistics
OS: Linux h
PHP: 5.2.17
MySQL: 5.1.63-community-log
Time: 03:09
Caching: Disabled
GZIP: Disabled
Members: 3
News: 368
Web Links: 5
Visitors: 266580
Popular