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 03-24-2005, 05:16 AM   #1
amer_58
Member
 
Registered: Mar 2004
Distribution: Slackware 10.2
Posts: 213

Rep: Reputation: 30
List all users, command


How can I list all the users name(shell)....
 
Old 03-24-2005, 05:33 AM   #2
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
All of the users are listed in the /etc/passwd file (you may need to be root to read it). It's also got a whole load of other information as well as the user names. To just get the user names, try something like:

cat /etc/passwd | cut -d":" -f1
 
Old 03-24-2005, 05:34 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Hi,

If you mean by (shell) from the command line:

awk -F":" '{ print $1 }' /etc/passwd

Hope this helps.
 
Old 03-24-2005, 06:46 AM   #4
amer_58
Member
 
Registered: Mar 2004
Distribution: Slackware 10.2
Posts: 213

Original Poster
Rep: Reputation: 30
Thanks guys.
 
Old 03-25-2005, 04:32 AM   #5
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Quote:
Originally posted by trevelluk
All of the users are listed in the /etc/passwd file (you may need to be root to read it). It's also got a whole load of other information as well as the user names. To just get the user names, try something like:

cat /etc/passwd | cut -d":" -f1
All users on the system should be able to read /etc/passwd as far as I know, or else they can't log in to the system.
 
Old 03-25-2005, 05:52 AM   #6
amer_58
Member
 
Registered: Mar 2004
Distribution: Slackware 10.2
Posts: 213

Original Poster
Rep: Reputation: 30
Thats right i was able to list the all the users without root power.
 
Old 03-25-2005, 06:07 AM   #7
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
Fair enough, my mistake. Need sleep.
 
  


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
What is the command to list users? neo_in_matrix Linux - Newbie 24 02-12-2014 10:43 PM
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
Command to run another command against a list of files psweetma Linux - General 3 11-09-2005 05:29 PM
command to list all users of the system?? simi_544 Linux - Networking 9 09-29-2005 03:00 AM
How to get list of system users from command line? tictocdoc Linux - General 3 03-12-2004 03:06 PM


All times are GMT -5. The time now is 11:14 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration