From owner-freebsd-questions Fri Jul 31 19:01:11 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA12938 for freebsd-questions-outgoing; Fri, 31 Jul 1998 19:01:11 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from lucy.bedford.net (lucy.bedford.net [206.99.145.54]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA12933 for ; Fri, 31 Jul 1998 19:01:08 -0700 (PDT) (envelope-from listread@lucy.bedford.net) Received: (from listread@localhost) by lucy.bedford.net (8.8.8/8.8.8) id VAA14959; Fri, 31 Jul 1998 21:44:46 -0400 (EDT) (envelope-from listread) Message-Id: <199808010144.VAA14959@lucy.bedford.net> Subject: Re: UID? In-Reply-To: <35C258A1.74FB20EC@turkey.ispro.net.tr> from Evren Yurtesen at "Aug 1, 98 02:52:01 am" To: yurtesen@turkey.ispro.net.tr (Evren Yurtesen) Date: Fri, 31 Jul 1998 21:44:46 -0400 (EDT) Cc: freebsd-questions@FreeBSD.ORG X-no-archive: yes Reply-to: djv@bedford.net From: CyberPeasant X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Evren Yurtesen wrote: [Charset iso-8859-9 unsupported, filtering to ASCII...] > hello > maybe this is stupid question but how may I know > which UID belonging to which user without looking in to > the password file? > thanks Ultimately, you (or a program) will have to look in the passwd database. In the general case, this is more complicated than just looking in /etc/passwd. There's a FreeBSD-specific utility, pw, to do this. (man pw). pw usershow NAME | cut -f3 -d: will display user NAME's uid. If you need to do this a lot, and to take actions based on the uid, or if the user is not found, you may wish to use a C program which calls the getpwnam(3) library routine. Dave -- Sancho Panza: `Microsoft Windows NT Server is the most secure network operating system available.' Don Quixote: `You are mistaken, Sancho.' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message