UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old February 5th, 2004, 08:59 AM
phidoux phidoux is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 96 phidoux User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 17 sec
Reputation Power: 5
Last login

Hey I need to write a script for linux, sun, aix, and hp, using advanced bash scripting that will take the last user login for all users, and report back with the time they logged in. It doesn't matter if each OS needs a different command. Any Ideas on what file to go to or what kind of a command I could use on this?

Reply With Quote
  #2  
Old February 5th, 2004, 11:40 AM
druuna druuna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 137 druuna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 37 sec
Reputation Power: 0
You can use last.

Works on sun, linux and hp. Don't know about aix (think it does).

Reply With Quote
  #3  
Old February 5th, 2004, 01:02 PM
phidoux phidoux is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 96 phidoux User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 17 sec
Reputation Power: 5
this would work but it only goes back to when the temp file was made. it won't necessarily be over 30 days old, which is how old i need it to be. When you first log in in *nix doesn't it tell you last time you logged in? Where does that information come from and how can I get to it.?

Reply With Quote
  #4  
Old February 5th, 2004, 01:43 PM
druuna druuna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 137 druuna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 37 sec
Reputation Power: 0
Ok, thought the extra info would be handy, but you are right about the file not going back 'forever'.

Take a look at lastlog

Works on all os flavors you mentioned (and more).

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Last login


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway