GETPWUID
Section: User Commands (1)
Updated: LOCAL
Index
Return to Main Contents
NAME
getpwnam - User information from user numeric identifier
SYNOPSIS
getpuid
[-Iacghnprsuv]
[-d
char
]
[ uid ... ]
DESCRIPTION
getpwuid
echoes user information given a list of possible user numeric identifiers.
Error messages generated from within the
getpwuid
utility are sent to stderr, not stdout, allowing the programmer to use
appropriate backquoting for this command.
If no arguments are given, the current effective user id is assumed.
USAGE
Options
- -I
-
Gives information about the program.
- -a
-
Same as setting cghnpsu flags. See below.
- -c
-
Will echo comment about user, typically name in English.
- -g
-
Will echo default group identifier (gid).
- -h
-
Will echo home directory.
- -n
-
Will echo user name.
- -p
-
Will echo user encrypted password.
- -r
-
Will report on exceptions to standard error, for example when groups are
not found.
- -s
-
Will echo default user shell.
- -u
-
Will echo user numeric identifier (uid).
- -v
-
True if the command is to work in verbose mode, not suitable for
backquoting and echoing more information to standard output or standard
error.
- -d
-
The character following the option indication is used as a delimiter
between output fields. The default is ':' in line with the format of
the /etc/group file.
- -?
-
Presents brief help text to the user. This option causes an error to
be returned as no user number is echoed.
EXAMPLE
example$ getpwuid -a
dtb:/j2cPZsqllg3Y:201:208:David T. Bath:/users/dtb:/.ucbbin/ksh
example$ getpwuid -rvgun 0 99 201 209
getpwuid: could not find user 99
usrname=root:uid=0:gid=0
usrname=dtb:uid=201:gid=208
usrname=marg:uid=209:gid=208
example$ getpwuid -vcnugs -d ,
usrname=dtb,uid=201,gid=208,comment=David T. Bath,shell=/.ucbbin/ksh
DIAGNOSTICS
The following values may be returned to the calling process:
-
- 0
-
No errors noted
- 1
-
Returned when the user information is not available.
- 12
-
ENOMEM: Problem with memory.
- 22
-
EINVAL: Invalid argument supplied.
FILES
/etc/passwd
SEE ALSO
passwd(4)
geteuid(2)
getpwuid(2)
getpwnam(1L)
AUTHOR
David T. Bath dtb@otto.bf.rmit.oz.au
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- USAGE
-
- Options
-
- EXAMPLE
-
- DIAGNOSTICS
-
- FILES
-
- SEE ALSO
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 21:51:21 GMT, February 02, 2023