- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Shell History with Date & Timestamps?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 07:50 PM
07-31-2005 07:50 PM
Shell History with Date & Timestamps?
I was wondering if anyone knows if it is possible to make the default POSIX shell history file ($HOME/.sh_history) contain not only the commands which have been executed by a user, but also for a date & timestamp to be added to the file to indicate the exact time when a command is run? Is there an easy way to do this, or would this require some clever scripting?
Thanks - Lee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 08:02 PM
07-31-2005 08:02 PM
Re: Shell History with Date & Timestamps?
The simplest way would be to set the variable up something like
$HOME/.sh_history.`date +%d%m_%H%M`
although this variable would only get refreshed each time the user logged in, so if they log in and stay logged in all day, you'll only get the 1 history file for them.
If you do a search for "timestamp history" on here, you'll get a bunch of links with other ideas
eg:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=896650
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 08:05 PM
07-31-2005 08:05 PM
Re: Shell History with Date & Timestamps?
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=245633
Regards,
Sergejs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 08:10 PM
07-31-2005 08:10 PM
Re: Shell History with Date & Timestamps?
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 08:42 PM
07-31-2005 08:42 PM
Re: Shell History with Date & Timestamps?
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=888550
thread.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 08:46 PM
07-31-2005 08:46 PM
Re: Shell History with Date & Timestamps?
trap 'date "+# %c" | read -s' debug
or turn on auditing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2005 08:30 AM
08-16-2005 08:30 AM