how to find my username? | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

how to find my username?

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-07-2006
kirrran kirrran is offline
Registered User
 
Join Date: Aug 2006
Last Activity: 7 August 2006, 5:19 PM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
how to find my username?

Hi
Any help is appreciated.
Say i login to a unix box, with uname "xyz". Later on, after a few interactions with the console, i change to the super-user with "sudo adminuid". and later on, how is it possible to get the latest set uid i.e., admin-uid? If i query for the system property os.user, i get the "xyz" uname with which i logged in. So, the qn is how to capture that shell specific uid?

thanks in advance.
Sponsored Links
    #2  
Old 08-07-2006
ajnabi ajnabi is offline
Registered User
 
Join Date: Nov 2001
Last Activity: 26 July 2009, 11:11 AM EDT
Location: Atlanta, GA
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
type whoami will give you the shell specific
Sponsored Links
    #3  
Old 08-07-2006
nathan nathan is offline VIP Member  
Supporter
 
Join Date: Jul 2006
Last Activity: 15 February 2012, 11:03 AM EST
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts

Code:
id -un

might also work.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
grep file to find unique instances of username 1075FJ40 UNIX and Linux Applications 4 01-14-2011 05:04 PM
Easy Script, just to find the given username if is it online or not aintour UNIX for Dummies Questions & Answers 5 10-14-2009 06:11 AM
To find the username in /etc/passwd file gsiva Shell Programming and Scripting 7 12-27-2008 11:54 AM
Find username of user running the script garric Shell Programming and Scripting 1 06-10-2008 03:44 AM
How to find who fingered my username anirudhkoul UNIX for Dummies Questions & Answers 3 04-06-2006 04:58 PM



All times are GMT -4. The time now is 12:16 AM.