PWCACHE(3) BSD Library Functions Manual PWCACHE(3)NAME
pwcache -- cache password and group entries
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <pwd.h>
char *
user_from_uid(uid_t uid, int nouser);
#include <grp.h>
char *
group_from_gid(gid_t gid, int nogroup);
DESCRIPTION
The user_from_uid() function returns the user name associated with the argument uid. The user name is cached so that multiple calls with the
same uid do not require additional calls to getpwuid(3). If there is no user associated with the uid, a pointer is returned to a string rep-
resentation of the uid, unless the argument nouser is non-zero, in which case a NULL pointer is returned.
The group_from_gid() function returns the group name associated with the argument gid. The group name is cached so that multiple calls with
the same gid do not require additional calls to getgrgid(3). If there is no group associated with the gid, a pointer is returned to a string
representation of the gid, unless the argument nogroup is non-zero, in which case a NULL pointer is returned.
SEE ALSO getgrgid(3), getpwuid(3)HISTORY
The user_from_uid() and group_from_gid() functions first appeared in 4.4BSD.
BSD June 9, 1993 BSD
Check Out this Related Man Page
PWCACHE(3) BSD Library Functions Manual PWCACHE(3)NAME
pwcache -- cache password and group entries
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <pwd.h>
char *
user_from_uid(uid_t uid, int nouser);
#include <grp.h>
char *
group_from_gid(gid_t gid, int nogroup);
DESCRIPTION
The user_from_uid() function returns the user name associated with the argument uid. The user name is cached so that multiple calls with the
same uid do not require additional calls to getpwuid(3). If there is no user associated with the uid, a pointer is returned to a string rep-
resentation of the uid, unless the argument nouser is non-zero, in which case a NULL pointer is returned.
The group_from_gid() function returns the group name associated with the argument gid. The group name is cached so that multiple calls with
the same gid do not require additional calls to getgrgid(3). If there is no group associated with the gid, a pointer is returned to a string
representation of the gid, unless the argument nogroup is non-zero, in which case a NULL pointer is returned.
SEE ALSO getgrgid(3), getpwuid(3)HISTORY
The user_from_uid() and group_from_gid() functions first appeared in 4.4BSD.
BSD June 9, 1993 BSD
Hi,
I need to find a string, if it finds then I need to print it , otherwise it has to goto next line....
input is====>
uid = shashi, india uid ,uid= asia
uid= none, uid=india. none
==========
output shold be
uid = shashi, india
uid ,
uid= asia
uid= none,
uid=india. none
... (1 Reply)
Hi there,
One can easily retrieve the uid from a username :
id -u $username
But how can we easily retrieve the gid from a group name?
I mean is there a command without using sed?
sed -nr "s/^$groupname:x:(+):.*/\1/p" /etc/group
Thanks for your help
Santiago (7 Replies)
I´m listing the contents of a directory using the command
ls -lI get numeric uid and gid for some lines.
example:
drwxr-xr-x root root 1970-01-01 01:00 sys
-rw-r--r-- 501 20 0 2010-08-04 14:54 shutdown.bravo.rc
drwxr-x--- 501 20 ... (5 Replies)
Hi,
I am new to scrippting need little help, I would like to change uid, gid of exisisting user,
example
User A current uid=1,gid=2 would like to change uid=4,gid=5
I know the command to change uid,gid but after changing I have to change permissions on folders also which are belonging... (3 Replies)
Hi,
I want to change user id gefadm ,uid=0(root) gid=0(root) to uid=16649(isaadmin) gid=16284(dstage),
how can i change this uid ,gid one value to another value.
Please provide the steps how can i change , uid=0(root) gid=0(root) to uid=16649(isaadmin) gid=16284(dstage).
Thanks in advance for... (2 Replies)
flamingo:~ joliver$ sudo find / -nogroup
find: /dev/fd/4: No such file or directory
find: /home: No such file or directory
find: /Library: No such file or directory
find: /net: No such file or directory
find: /Network: No such file or directory
find: /private: No such file or directory
find:... (2 Replies)
Hi,
Iv got the following input
$id |grep uid
uid=6090(dsiddiq) gid=1(staff) groups=4001(cdgrp)
and Im using the below command to split the field to grab the numberical userid as well the alphabetical userid
$id|awk -F'=' '{print $2}'|awk -F')' '{print $1}'|awk -F'(' '{print $1" "$2}'... (4 Replies)