LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   User Id (https://www.linuxquestions.org/questions/linux-newbie-8/user-id-463104/)

prospekrisal 07-11-2006 07:34 PM

User Id
 
Is user ID person who is in the current system?

fahrisal@linux:~> who am i
fahrisal pts/1 2006-07-12 08:22

Is "fahrisal" a user ID?

how to identify whether the particular user has logged in (using shell script)?

Tinkster 07-11-2006 07:39 PM

It's a name, not an id. The uid is a numerical value.

To retrieve the name there's several possibilities.
Code:

a) the one you already listed `who am i`
b) echo $LOGNAME
c) `id` which will give you pretty much all you need to
  know about the user you're currently running the program
  id as ... :} (in terms of id and groups, that is).



Cheers,
Tink

prospekrisal 07-11-2006 07:51 PM

So, could u gimme the example of UID in terminal program!!

nadroj 07-11-2006 08:13 PM

check out 'man id', as Tinkster suggested.

twilli227 07-11-2006 08:48 PM

Code:

twilli@ubuntu:~$ id
uid=1000(twilli) gid=1000(twilli) groups=4(adm)1000(twilli)



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