Results 1 to 3 of 3

Thread: how do i solve this question...

Hybrid View

  1. #1

    how do i solve this question...

    how do i show the last 4 users which entered the system(not last 4 logins)
    i tried this
    last -4|cut -d" " -f1| uniq -u

    but its not working

    i was told to
    "Do the last command ... send (all) the output to cut and get just the user, send THAT output on to uniq (to get unique values) then send that on to head to get the top 4 entries."

    can some one help me to interpret these words to command?? :

    about the first part ,do i need only wright "last"
    about the second part ,what option to use in the uniq command

    and the last one
    how do i send that on to head to get the top 4 entries??

    i dont know if this is the right way.
    i dont care what command will lead to the result


    i just want the list of the last 4 users which logged in??

    i tried lots of combination that didnt work
    plz help

  2. #2
    Quote Originally Posted by googler View Post
    how do i show the last 4 users which entered the system(not last 4 logins)
    i tried this
    last -4|cut -d" " -f1| uniq -u

    but its not working

    i was told to
    "Do the last command ... send (all) the output to cut and get just the user, send THAT output on to uniq (to get unique values) then send that on to head to get the top 4 entries."

    can some one help me to interpret these words to command?? :

    about the first part ,do i need only wright "last"
    about the second part ,what option to use in the uniq command

    and the last one
    how do i send that on to head to get the top 4 entries??

    i dont know if this is the right way.
    i dont care what command will lead to the result


    i just want the list of the last 4 users which logged in??

    i tried lots of combination that didnt work
    plz help
    last |head -4 |cut -d" " -f1

    You don't want to use uniq.

  3. #3
    Junior Member
    Join Date
    Sep 2006
    Posts
    70
    Try this:
    last -4 | awk '{print$1}' | uniq | sort

Similar Threads

  1. "TELNET-SERVER" connection problem...help me to solve
    By ringque in forum Linux - Hardware, Networking & Security
    Replies: 4
    Last Post: 03-02-2010, 08:33 PM
  2. is there any body who can solve my problem
    By fortune2080@hotmail.com in forum General Chat
    Replies: 4
    Last Post: 10-24-2006, 06:13 PM
  3. Can't solve it...
    By elovkoff in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 12-25-2003, 08:40 PM
  4. Will ducttape solve my problem?
    By in forum General Chat
    Replies: 5
    Last Post: 11-27-2002, 05:28 AM
  5. D.E.S. question
    By traceroute in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 05-23-2002, 10:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •