Fedora - CLI for list all users?


Anyone know the command?
fcekAsked:
Who is Participating?
 
farzanjCommented:
You will have to look into /etc/passwd or /etc/shadow file

Issue the following command




cat /etc/shadow | grep -v '[*!]' | cut -d: -f1

Open in new window

0
 
farzanjCommented:
The above would list all the users who have local access (not LDAP/NIS etc.) on the system

If you mean the users currently logged in, issue the following

w

or

who
0
 
wesly_chenCommented:
For Samba,
# smbstatus -b
Prints the connected users to each Samba host on the current server.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
upanwarCommented:
If you want to list all users in your Linux box, including /ect/passwd, LDAP and NIS.

Then you should use below given command to get list of users who can get authenticate to your system.

# getent passwd

If you want to grep a particular user then use.

# getent passwd | grep <user name>


http://en.wikipedia.org/wiki/Getent

0
 
omarfaridCommented:
try

awk -F":" '{ print $1 }' /etc/passwd

for logged in users try

w

or

who
0
 
fcekAuthor Commented:
Thanks everyone.
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.

All Courses

From novice to tech pro — start learning today.