- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How retrive the commands list issued one week ago
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
Discussions
Discussions
Forums
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
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
тАО12-08-2003 08:31 AM
тАО12-08-2003 08:31 AM
How retrive the commands list issued one week ago
Thanks
Singaram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2003 08:33 AM
тАО12-08-2003 08:33 AM
Re: How retrive the commands list issued one week ago
/home_directory/.sh_history
For this data to be collected, two variables must be set in the user environment.
HISTFILE=$HOME/.sh_history
HISTSIZE=5000
The actual value in the HISTFILE variable will tell you where the command log is.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2003 08:37 AM
тАО12-08-2003 08:37 AM
Re: How retrive the commands list issued one week ago
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2003 08:39 AM
тАО12-08-2003 08:39 AM
Re: How retrive the commands list issued one week ago
If this has been set in /etc/profile or .profile of the user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2003 08:39 AM
тАО12-08-2003 08:39 AM
Re: How retrive the commands list issued one week ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2003 08:43 AM
тАО12-08-2003 08:43 AM
Re: How retrive the commands list issued one week ago
# Set up logging
HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`
date >>$HISTFILE
export HISTFILE
HISTSIZE=500
export HISTSIZE
That creates a seperate .sh_history for each root user. It time stamps each time they log in...
To go back a month - that would requre using something like cron to echo the date to everyone's .sh_history say at midnight every night - then you would be able to see the commands users used each day....
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-09-2003 04:45 AM
тАО12-09-2003 04:45 AM
Re: How retrive the commands list issued one week ago
Thanks
Singaram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-09-2003 04:50 AM
тАО12-09-2003 04:50 AM
Re: How retrive the commands list issued one week ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-09-2003 05:33 AM
тАО12-09-2003 05:33 AM
Re: How retrive the commands list issued one week ago
try this
greetings,
Michael
DATE=`date "+%b_%Y"`
if [ ! -f ${HOME}/.shistory_${DATE}.* ]
then
VERSION=1;
else
HISTFILE=`ls $HOME/.shistory_${DATE}.*|tail -1`
VERSION=`expr "${HISTFILE}" : ".*_.........\(.*\)$"`
LCOUNT=`cat ${HISTFILE} | wc -l | awk '{print $1}'`
if [ ${LCOUNT} -gt 4900 ]
then
let VERSION=VERSION+1
fi
fi
HISTFILE=${HOME}/.shistory_${DATE}.${VERSION}
export HISTFILE
HISTSIZE=5000
export HISTSIZE