Solved

How to find out Linux users in Centos 6

Posted on 2012-04-03
4
693 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

863 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

23 Experts available now in Live!

Get 1:1 Help Now