Solved

How to find out Linux users in Centos 6

Posted on 2012-04-03
4
690 Views
Last Modified: 2012-06-21
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
Comment
Question by:RandallVillalobos
4 Comments
 
LVL 3

Accepted Solution

by:
deepak_iq earned 250 total points
ID: 37803484
cat /etc/passwd
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 130 total points
ID: 37803497
cut -f1 -d":"  /etc/passwd

A "pure shell" solution:

while read line; do echo ${line%%:*} ; done < /etc/passwd
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 120 total points
ID: 37803518
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
 

Author Closing Comment

by:RandallVillalobos
ID: 37803544
Amazing, I'm enjoying this Linux journey! thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now