LinuxQuestions.org
Register a domain and help support LQ
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, 11: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, 11: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 11:27 AM.
 
1 members found this post helpful.
Old 01-15-2012, 11:45 AM   #3
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Rep: Reputation: 48
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 11:46 AM.
 
1 members found this post helpful.
Old 01-16-2012, 12:05 AM   #4
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Thanks All
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 12:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration