Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-12-2004, 10:14 AM   #1
LQ Newbie
Registered: Sep 2003
Location: Houston,TX
Distribution: RedHat/SuSe/Mandrake
Posts: 20

Rep: Reputation: 0
How to get list of system users from command line?


What command can I use to list the user's on a RH system from the command line??
Old 03-12-2004, 10:22 AM   #2
Registered: Feb 2004
Location: Sacramento, CA
Distribution: Slack 9.1, slackware-current
Posts: 284

Rep: Reputation: 30
Old 03-12-2004, 10:38 AM   #3
LQ Newbie
Registered: Sep 2003
Location: Houston,TX
Distribution: RedHat/SuSe/Mandrake
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks for the reply. Maybe I should have been more specific in my question. Apologies...

How can a get a list of all system users (UID #500+), including those not currently logged in?
Old 03-12-2004, 03:06 PM   #4
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Here's one simple way anyway,

let userid=500
for i in `cat /etc/passwd`
 let j=`echo $i | cut -f 3 -d ':' 2>/dev/null`
 if [ $j -ge $userid ]
    echo $i
or just look in your /etc/passwd file


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 On
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 27 11-29-2017 06:09 AM
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
command to list all users of the system?? simi_544 Linux - Networking 9 09-29-2005 03:00 AM
List all users, command amer_58 Linux - Newbie 6 03-25-2005 06:07 AM
How may I list only the directories in command line? geraldomanaus Linux - Newbie 5 03-20-2003 12:40 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:34 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration