- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Last command
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
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
01-10-2006 01:39 AM
01-10-2006 01:39 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 01:44 AM
01-10-2006 01:44 AM
Solutionlast command includes a date display.
run your last output and grep for the last three days.
last | grep "Mar 17" for example.
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
01-10-2006 01:47 AM
01-10-2006 01:47 AM
Re: Last command
Will want to parse out doing some date calculations.
Get a hold of Clay's date calculator, This will do the math for you then you can select those entries that match the results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 01:54 AM
01-10-2006 01:54 AM
Re: Last command
If all you want is the last 3-days of login information, then you are going to have to parse that out.
You could use a simple 'grep' with multiple ('-e') patterns for instance.
If you want the last 3-days of *every* login no matter when the 3-days occured, I'd convert the binary file to ASCII with '/usr/sbin/acct/fwtmp' and use the epoch seconds to isolate the day ranges of interest on a per-user basis.
Examine the manpages for 'wtmps(4)' and 'fwtmp(1M)' for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 01:55 AM
01-10-2006 01:55 AM
Re: Last command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 02:11 AM
01-10-2006 02:11 AM
Re: Last command
Every night at 5 to midnight run script
on a directory where you have 3 files
rm oldest
mv older oldest
mv file older
last -R |grep "$(date| cut -f1-3 -d" ")" >
file
cat oldest
cat older
cat file
Same for bads
Steve Steel