LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 06: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, 06:38 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Code:
grep <uid> /etc/passwd
Same for all *nix
 
Old 01-30-2013, 03: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, 05: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, 06:30 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
...or the distro-agnostic 'getent passwd [uid|user]'
 
Old 01-30-2013, 08: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



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 05:07 PM
Find command for no login user files mohanan.sandeep Linux - Software 4 02-23-2011 03:25 PM
[SOLVED] Bash command to find out if user exists brgsousa Linux - Software 3 01-20-2011 01:13 PM
command to find sound card in RHEL version 3 hsmukunda Linux - Enterprise 4 11-29-2006 01:25 PM
find command : finding files that are created within last 24 hours Fond_of_Opensource Linux - Newbie 1 11-06-2006 03:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:52 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
Open Source Consulting | Domain Registration