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 01-15-2012, 10:12 AM   #1
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Rep: Reputation: 0
Exclamation example on the cut slide to display a list of users logged in.


example on the cut slide to display a list of users logged in.

I know who will be used, but in the delimiter part dont know how to specify a space or a tab
 
Old 01-15-2012, 10:21 AM   #2
Dick Dastardly
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Rep: Reputation: Disabled
Specify a space like
Code:
echo "a b c"|cut -d" " -f2
Just put a tab in place of the space (cut -d" ") for tabs.

This should do the trick

Code:
who -u|cut -d" " -f1|uniq

Last edited by Dick Dastardly; 01-15-2012 at 10:27 AM.
 
1 members found this post helpful.
Old 01-15-2012, 10:45 AM   #3
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
Code:
[demo@localhost ~]$ who | cut -d " " -f 1
demo
demo
[demo@localhost ~]$ who | cut -d " " -f 1 | uniq
demo


[demo@localhost ~]$ who | awk '{print $1}' | sort -u
demo
[demo@localhost ~]$

Last edited by devUnix; 01-15-2012 at 10:46 AM.
 
1 members found this post helpful.
Old 01-15-2012, 11:05 PM   #4
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Thanks All
 
  


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
checking list of logged in users, without logging in to that linux pc. krishnalite Programming 7 07-18-2010 09:22 PM
Bash command to list users logged in at 5pm F4U57 Linux - Newbie 2 06-07-2010 10:37 PM
List users logged in to remote system jantman Linux - Software 3 12-11-2006 12:01 AM
How do I list all users (even those not logged in) steved Linux - Newbie 2 09-29-2005 04:45 PM
how can i see list of logged on users? doublefailure Linux - General 6 09-10-2002 08:11 PM

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

All times are GMT -5. The time now is 03:07 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