Awk - user's computer usage


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Awk - user's computer usage
# 1  
Old 04-29-2009
Awk - user's computer usage

Hi! I need help with this:

I want to write an AWK script, that matches computer usage of users, listed at the available log file, Users.log.
Which is how many times a user has entered, and how much time was logged in?


for example:
$ cat Users.log
user1; login, 2009-03-26, 10:30
user2; login, 2009-03-26, 11:07
user2; logoff, 2009-03-26, 12:20
user1, logoff, 2009-03-26, 12:00
user3; login, 2009-03-26, 16:53
user3; logoff, 2009-03-26, 19:54
user1; login, 2009-03-26, 20:11
user1, logoff, 2009-03-26, 21:32

$ ./userstat.awk Users.log
output:
user1: 2 times, 2 hours 51 minutes
user2: 1 time, 1 hour 13 minutes
user3: 1 time, 3 hours 1 minute
# 2  
Old 04-29-2009
show your code.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Memory usage per user,percent usage,sytem time in ksh

Let's say i have 20 users logged on Server. How can I know how much memory percent used each of them is using with system time in each user? (2 Replies)
Discussion started by: roy1912
2 Replies

2. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

3. Shell Programming and Scripting

basic computer usage report

Our small company, about 5 users, need a basic script that scans mapped network drives (example: drive b,c,d, e, and f) for hard drive usage. This needs to send a report to myself in any type of basic notepad format (easy to read and decipher) for drives that have reached 80% usage... any ideas? ... (1 Reply)
Discussion started by: jessessays
1 Replies

4. Shell Programming and Scripting

Disk Usage for each user

I have created a program using the unix bash shell and i wanted to know how i can get the disk usage displayed for a specific user based on desired username inputted by a user. If somebody could give me an example of the code this would be helpful. Thanks (1 Reply)
Discussion started by: warlock129
1 Replies

5. Shell Programming and Scripting

Total usage memory by user

Hi, When running top on linux redhat machine , i see that i have 16gb of memory in my machine and about 14.5gb of memory are in use: Mem: 16395780k total, 14970960k used, 1424820k free, 370264k buffers Swap: 4192956k total, 25824k used, 4167132k free, 12029400k cached How can i... (3 Replies)
Discussion started by: yoavbe
3 Replies

6. UNIX for Advanced & Expert Users

currenlty logged in user on remote computer

Hello everyone Does anyone know, if there is a command that tells you who is logged in on remote host? I'm ssh-ing as root to the remote host and then run whoami but that doesn't tells me who is logged in that particular computer instead shows my remote login. Is there a way to do that?... (2 Replies)
Discussion started by: goude
2 Replies

7. UNIX for Advanced & Expert Users

loggin remote computer as a super user.

hello all, can i loggin remote computer as a super user(i know root user/passwd) and change his access controlle list. if yes please tell me how to do it, i am new to linux. thank you. (6 Replies)
Discussion started by: zius_oram
6 Replies

8. HP-UX

CPU usage per user

Hello everybody, How can we proceed to measure the CPU used par a user on unix HPUX ? there some commands or tools ? Thank you in advance. (4 Replies)
Discussion started by: mlaiti
4 Replies

9. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

10. UNIX for Dummies Questions & Answers

Computer Usage

Is there a program on Linux that allows you to monitor Hard Disk, RAM, and CPU Usage. (Would be nice to see CPU Temp as well). We have a Linux firewall, with an AMD Duron 950 CPU, 256MB RAM. It seems to fall over when too many people access the website. It is maintained by another company and... (5 Replies)
Discussion started by: potter
5 Replies
Login or Register to Ask a Question