• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 841
  • Last Modified:

How to find out Linux users in Centos 6

Experts,

Hi an easy question.  How do I find out the list of users that are available in my CentOS server?
CentOS release 6.2

Thank you
0
RandallVillalobos
Asked:
RandallVillalobos
3 Solutions
 
deepak_iqCommented:
cat /etc/passwd
0
 
woolmilkporcCommented:
cut -f1 -d":"  /etc/passwd

A "pure shell" solution:

while read line; do echo ${line%%:*} ; done < /etc/passwd
0
 
omarfaridCommented:
if you want list of logged in users then use

who
or
w

if you want to find users names then look at /etc/passwd file in the first field

you can run

awk -F: '{ print $1 }' /etc/passwd
0
 
RandallVillalobosAuthor Commented:
Amazing, I'm enjoying this Linux journey! thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now