Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-12-2012, 05:10 AM   #1
LQ Newbie
Registered: Jan 2012
Posts: 5

Rep: Reputation: Disabled
How to know the current users in the Linux ?

I have been trying to use cat /etc/passwd | cut -d":" -f1 command , but I note that the result contain many users , knowing that i have 2 users plus the root user.
so how i could list just these three users ???

I have tried a search on Google, but I really don't know what I need to search for. Can anyone help me to solve this? Please bear in mind that I am new to this and so would appreciate being told in plain English what I need to do or where I need to start.

Last edited by mohgam; 01-12-2012 at 05:28 AM.
Old 01-12-2012, 05:18 AM   #2
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 189Reputation: 189
Assuming the all the users you want to view are using bash as their shell,
grep "bash" /etc/passwd
Old 01-12-2012, 06:11 AM   #3
LQ Newbie
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanx fukawi1 , yes its work

but I notice that the root user can't be seen under home ???

is it normal ???
Old 01-12-2012, 09:46 AM   #4
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,191
Blog Entries: 4

Rep: Reputation: 464Reputation: 464Reputation: 464Reputation: 464Reputation: 464
Moved: This thread is more suitable in Linux-General and has been moved accordingly to help your thread/question get the exposure it deserves.
Old 01-12-2012, 10:14 AM   #5
Registered: Mar 2011
Posts: 343

Rep: Reputation: Disabled

Originally Posted by mohgam View Post
but I notice that the root user can't be seen under home ???

is it normal ???
Yes, it is normal. root's home directory is /root.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Current logged in users deci007 Linux - Newbie 4 11-25-2009 04:06 AM
Current Users on Internet ManRSA Linux - Networking 1 12-07-2006 04:56 AM
how to View Current Logged In Users scialom Linux - Software 1 10-20-2004 10:13 AM
Slackware-current users: hkctr Slackware 8 05-24-2004 12:08 AM
List Current SFTP users smurf Linux - Networking 0 02-12-2004 02:02 AM

All times are GMT -5. The time now is 11:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration