LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 03-12-2004, 11:14 AM   #1
tictocdoc
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?


Hello:

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

Rep: Reputation: 30
`who`
 
Old 03-12-2004, 11:38 AM   #3
tictocdoc
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, 04:06 PM   #4
Looking_Lost
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,

Code:
#!/bin/bash
let userid=500
                                                                                
IFS="
"
for i in `cat /etc/passwd`
do
 let j=`echo $i | cut -f 3 -d ':' 2>/dev/null`
                                                                                
 if [ $j -ge $userid ]
  then
    echo $i
 fi
done
or just look in your /etc/passwd file
 
  


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


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