Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 743
  • 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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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