Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to find out Linux users in Centos 6

Posted on 2012-04-03
4
Medium Priority
?
736 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 1000 total points
ID: 37803484
cat /etc/passwd
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 520 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 480 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

Lessons on Wi-Fi & Recommendations on KRACK

Simplicity and security can be a difficult  balance for any business to tackle. Join us on December 6th for a look at your company's biggest security gap. We will also address the most recent attack, "KRACK" and provide recommendations on how to secure your Wi-Fi network today!

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

972 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