[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Unix system stats

Posted on 2007-12-02
9
Medium Priority
?
478 Views
Last Modified: 2013-12-26
How can I generate an statistic, sorted from lowest to highest, of the 10 users that have logged into the system less times over the last month amongst all the users that have logged into the system in this period of time?? (wow :) )
0
Comment
Question by:axtur
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 20393030
Your OS version please?
post the ouput of:
uname -a command

also
man last
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20394692
Hi

try

last | awk '{print $1}' | sort | uniq -c | more
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20394768
Hi,

try

last | grep -v wtmp | awk '{print $1}' | sort | uniq -c | sort > /tmp/u.$$
c=`wc -l < /tmp/u.$$`
c=`expr $c - 1`
tail -$c /tmp/u.$$
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:axtur
ID: 20397381
I only need 10 results, with that I'm getting more than just 10, any help?
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20400488
last | grep -v wtmp | awk '{print $1}' | sort | uniq -c | sort > /tmp/u.$$
c=`wc -l < /tmp/u.$$`
c=`expr $c - 1`
tail -$c /tmp/u.$$ | head -10
      
0
 
LVL 48

Accepted Solution

by:
Tintin earned 750 total points
ID: 20400722
last | egrep -v "reboot|wtmp" | awk '{print $1}' | sort | uniq -c | sort -n | tail - 10
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 750 total points
ID: 20400776
Hi,

Thank you Tintin :)

Correction:

last | egrep -v "reboot|wtmp" | awk '{print $1}' | sort | uniq -c | sort -n | tail - 10

What about the empty line?

0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20400777
Hi,

Thank you Tintin :)

Correction 2:

last | egrep -v "reboot|wtmp" | awk '{print $1}' | sort | uniq -c | sort -n | tail -10

What about the empty line?

      
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20400903
Hi,

Tintin I am just modifying your solution by head rather tail

last | egrep -v "reboot|wtmp" | awk '{print $1}' | sort | uniq -c | sort -n | head  -10
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question