The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Displaying current user process felixwhoals Shell Programming and Scripting 14 12-16-2007 07:00 PM
Last user login date JTeter UNIX for Dummies Questions & Answers 2 04-03-2007 09:38 AM
Collecting & Displaying of Last User ID and Date of Last Login amittal Shell Programming and Scripting 1 03-22-2007 12:18 AM
Displaying file names before a particular creation date dhruv_saksena UNIX for Dummies Questions & Answers 1 09-02-2005 09:19 AM
displaying date minazk Shell Programming and Scripting 7 11-14-2002 12:04 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-21-2007
amittal amittal is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 5
Exclamation Collecting & Displaying of Last User ID and Date of Last Login

Hi,

I needed to write a script to "Collect and Display the Last User ID and Date of Last Login".

The requirement is:
When a workstation stops reporting it could be for many reasons. If we know the last person who logged in before the workstation came down, then we can contact the last person to login to that specific machine and ask them if they know what has happened to the workstation.

Can someone provide a script to "Collecting & Displaying of Last User ID and Date of Last Login".

Thanks in advance,
amittal
  #2 (permalink)  
Old 03-21-2007
pressy's Avatar
pressy pressy is offline Forum Staff  
solaris cultist
  
 

Join Date: Aug 2003
Location: Vienna / Austria (Europe) [EARTH]
Posts: 726
last - display login and logout information about users and terminals

The last command looks in the /var/adm/wtmpx file, which
records all logins and logouts, for information about a
user, a terminal, or any group of users and terminals. Argu-
ments specify names of users or terminals of interest. If
multiple arguments are given, the information applicable to
any of the arguments is printed. For example, last root con-
sole lists all of root's sessions, as well as all sessions
on the console terminal. last displays the sessions of the
specified users and terminals, most recent first, indicating
the times at which the session began, the duration of the
session, and the terminal on which the session took place.
last also indicates whether the session is continuing or was
cut short by a reboot.

example:

Code:
root@mp-wst01 # last -a | more
pressy    pts/3        Wed Mar 21 18:53   still logged in  pressynb.ips.local
pressy    sshd         Wed Mar 21 18:53   still logged in  pressynb.ips.local
root      pts/2        Wed Mar 21 18:50   still logged in  pressynb.ips.local
root      sshd         Wed Mar 21 18:50 - 18:53  (00:02)   pressynb.ips.local
root      pts/2        Wed Mar 21 17:51 - 17:52  (00:00)   pressynb.ips.local
root      sshd         Wed Mar 21 17:51 - 17:52  (00:00)   pressynb.ips.local
root      pts/2        Wed Mar 21 17:40 - 17:40  (00:00)   pressynb.ips.local
root      sshd         Wed Mar 21 17:40 - 17:40  (00:00)   pressynb.ips.local
root      pts/2        Wed Mar 21 16:36 - 17:07  (00:31)   pressynb.ips.local
root      sshd         Wed Mar 21 16:36 - 17:07  (00:31)   pressynb.ips.local


regards pressy
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0