LinuxQuestions.org
Review your favorite Linux distribution.
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 11-11-2009, 03:55 PM   #1
Zero187
Member
 
Registered: May 2009
Posts: 32

Rep: Reputation: 15
Command to show ONLY super users


I've been messing around with BASH for a few months now, but I have come across a problem where I need to output ONLY the usernames of the super users. What command will do this? I tried searching all over Google, but found nothing.

Thanks,
Brian
 
Old 11-11-2009, 03:58 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
In general, there should only be one super-user on the system, root. You can print all users who have UID =0 in /etc/passwd with:

awk -F':' '($3 == 0) {print $1}' /etc/passwd

But there is usually only one name -- root. Note, this doesn't print users who might have sudo priviliges, you'd have to look in the /etc/sudoers file for that information.
 
  


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
Any super users out there? perry Linux - Newbie 4 10-28-2007 07:21 PM
Super Karamba - CPU temp no show andy-k Linux - Software 1 08-24-2007 05:13 PM
command to show all the login users sessions RajRed Linux - Newbie 3 04-18-2006 09:24 AM
How can I create super users tariq_ned Linux - General 2 03-06-2006 03:33 AM
Non Super Users can not access VFAT Partition shane25119 Linux - General 7 09-11-2004 11:25 AM


All times are GMT -5. The time now is 09:30 PM.

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