LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-15-2005, 11:59 AM   #1
cboswell
LQ Newbie
 
Registered: Jul 2005
Posts: 2

Rep: Reputation: 0
"last" command


Hi all,

Not only am I new to Linux Redhat, but I'm the default administrator of a multiuser system. I see that the "last" command will call up the history of logins. It would be very helpful to be able to extract from this history a report that lists, for each login, user name, their login time and total time on the system. Additional info extracted from their profiles to help identify them would be helpful but is not critical. Exportation to a spreadsheet would be ideal.

I've found many helpful sources for Administration and user profile setups, but nothing that addresses this specific question.

Any suggestions?
Thanks in advance,
Carl
 
Old 07-15-2005, 12:30 PM   #2
J_K9
Member
 
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700

Rep: Reputation: 30
Well...are you able to program? I'm not sure (but it is highly unlikely that there is a command which can do all that for you). Although I haven't come across a program like that, I know that the "last" command takes its info from /var/log/wtmp, so if you do know how to program that would be the ideal place to get your input from.

How many users are there, and how often would you like the "spreadsheet" to be updated? If it's not too often, and there aren't too many users, then you can always just "cat /var/log/wtmp > logins.txt" or just "last > logins.txt", and then sort that info out.

I've had a good look on Google but have been unable to find any GUI programs which do what you say. Maybe you could make the first one!

J_K9

Last edited by J_K9; 07-15-2005 at 12:32 PM.
 
Old 07-15-2005, 08:05 PM   #3
cboswell
LQ Newbie
 
Registered: Jul 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the reply, J_K9.

To answer your questions, there could be up to 25-50 logins over a two week period that I would normally use for billing. I wasn't really expecting a GUI to do this sort of thing, just some lines of code that would sort out the contents of the file.

I'll look into your suggestions and see what I get.

Thanks again.
Carl
 
Old 07-16-2005, 12:14 AM   #4
J_K9
Member
 
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700

Rep: Reputation: 30
Sorry I couldn't be of more help! And there must be at least one program that does something like that for you, however good it may be. Anyway, I'm learning C++, so you've given me an idea for my first project in Linux! Cheers,

J_K9
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 07:42 AM
cdrecord command-line parentheses "(" ")" coolingtower Linux - Software 1 10-28-2005 11:49 AM
"stalled" problem in " scp" command gentleshark Linux - Software 1 08-30-2005 02:08 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-21-2003 11:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration