LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-11-2006, 07:34 PM   #1
prospekrisal
LQ Newbie
 
Registered: May 2006
Location: Kuching, Malaysia
Posts: 26

Rep: Reputation: 15
Question 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)?
 
Old 07-11-2006, 07:39 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 07-11-2006, 07:51 PM   #3
prospekrisal
LQ Newbie
 
Registered: May 2006
Location: Kuching, Malaysia
Posts: 26

Original Poster
Rep: Reputation: 15
So, could u gimme the example of UID in terminal program!!
 
Old 07-11-2006, 08:13 PM   #4
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
check out 'man id', as Tinkster suggested.
 
Old 07-11-2006, 08:48 PM   #5
twilli227
Member
 
Registered: May 2003
Location: S.W. Ohio
Distribution: Ubuntu, OS X
Posts: 760

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


Reply



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
C program to see user log on in system and print user with real user name also naveen245 Programming 2 12-21-2005 12:53 AM
Load kde profile from /mnt/removable/user instead of /home/user preacher.ca Linux - General 3 12-02-2005 03:00 PM
grant user access to /fat-c & copying users' preferences to another user n0x Linux - Newbie 1 07-04-2004 12:04 AM
Games runs slow as normal user, but fast as root user mcore Linux - Software 2 06-07-2004 11:11 PM
Pleasehelp with proftpd.conf - trying to config user to write files as other user. philg Linux - Software 1 06-21-2003 12:13 PM

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

All times are GMT -5. The time now is 04:12 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