LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-29-2013, 07:35 PM   #1
thirstonlinux
Member
 
Registered: Jul 2011
Posts: 62

Rep: Reputation: Disabled
In RHEL 6, what is the command you will use to find if a user ID is created?


In RHEL 6, what is the command you will use to find if a user ID is created?

---------- Post added 01-30-13 at 06:06 AM ----------

Difference between RHEL 5 and RHEL 6
 
Old 01-29-2013, 07:38 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Code:
grep <uid> /etc/passwd
Same for all *nix
 
Old 01-30-2013, 04:41 AM   #3
vipin310379
LQ Newbie
 
Registered: Jan 2013
Location: Moga, Punjab
Distribution: Redhat
Posts: 19

Rep: Reputation: Disabled
# id <name-of-user>

this will show you the uid of the user
 
Old 01-30-2013, 06:45 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
As already suggested above, you can use either:-
Code:
~$ id <username>
OR
~$ id -a <usrename>
OR
~$ finger <username>
Or your can verify it from /etc/passwd.
 
Old 01-30-2013, 07:30 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
...or the distro-agnostic 'getent passwd [uid|user]'
 
Old 01-30-2013, 09:39 AM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by unSpawn View Post
...or the distro-agnostic 'getent passwd [uid|user]'

It will work on systems running on some naming service like NIS. So one more (on NIS based system):-
Code:
~$ ypmatch <uid|username> passwd
 
  


Reply

Tags
user id


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to find who created the user nallanisai Linux - General 1 03-05-2011 06:07 PM
Find command for no login user files mohanan.sandeep Linux - Software 4 02-23-2011 04:25 PM
[SOLVED] Bash command to find out if user exists brgsousa Linux - Software 3 01-20-2011 02:13 PM
command to find sound card in RHEL version 3 hsmukunda Linux - Enterprise 4 11-29-2006 02:25 PM
find command : finding files that are created within last 24 hours Fond_of_Opensource Linux - Newbie 1 11-06-2006 04:47 AM


All times are GMT -5. The time now is 10:01 PM.

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