LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 10: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, 10: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, 10: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, 03: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:04 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
Open Source Consulting | Domain Registration