Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ././../../../../../../usr/man/man8/getent.8
Real path: /usr/share/man/man8/getent.8
Zurück
'\" te .\" Copyright (c) 1999, 2022, Oracle and/or its affiliates. .TH getent 8 "6 Oct 2022" "Oracle Solaris 11.4" "System Administration Commands" .SH NAME getent \- get entries from administrative database .SH SYNOPSIS .LP .nf \fBgetent\fR \fIdatabase\fR [\fIkey\fR]... .fi .SH DESCRIPTION .sp .LP \fBgetent\fR gets a list of entries from the administrative database specified by \fIdatabase\fR. The information generally comes from one or more of the sources that are specified for the \fIdatabase\fR in \fBnsswitch.conf\fR(5). .sp .LP \fIdatabase\fR is the name of the database to be examined. This value can be \fBpasswd\fR, \fBgroup\fR, \fBhosts\fR, \fBipnodes\fR, \fBservices\fR, \fBprotocols\fR, \fBethers\fR, \fBnetworks\fR, \fBnetmasks\fR, \fBproject\fR, \fBuser_attr\fR, \fBprof_attr\fR, \fBauth_attr\fR, \fBexec_attr\fR, \fBautomount\fR, \fBnetgroup\fR, \fBinitgroups\fR, \fBrpc\fR, or \fBshadow\fR. For each of these databases, \fBgetent\fR uses the appropriate library routines as described below. Many of the databases support enumeration if no \fIkey\fR is specified on the command line. Not all databases have documented \fBlibc\fR(3LIB) interfaces. Man page references are supplied for each database that has supported and documented interfaces. .sp .LP Supported databases: .sp .ne 2 .mk .na \fB\fBpasswd\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetpwnam\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBgroup\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetgrnam\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBhosts\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgethostbyname\fR(3C). The DNS repository does not enumerate the hosts database. .RE .sp .ne 2 .mk .na \fB\fBipnodes\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetipnodebyname\fR(3C). The DNS repository does not enumerate the ipnodes database. .RE .sp .ne 2 .mk .na \fB\fBservices\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetservbyname\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBprotocols\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetprotobyname\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBethers\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBethers\fR(3C). This database does not support enumeration. .RE .sp .ne 2 .mk .na \fB\fBnetworks\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetnetbyname\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBnetmasks\fR\fR .ad .RS 14n .rt There are no public interfaces for this database. This database does not support enumeration. .RE .sp .ne 2 .mk .na \fB\fBproject\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetprojbyname\fR(3PROJECT). .RE .sp .ne 2 .mk .na \fB\fBuser_attr\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetuserattr\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBprof_attr\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetprofattr\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBauth_attr\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetauthattr\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBexec_attr\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetexecattr\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBnetgroup\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetnetgrent\fR(3C). This database does not support enumeration. .RE .sp .ne 2 .mk .na \fB\fBinitgroups\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetgrouplist\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBrpc\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetrpcbyname\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBshadow\fR\fR .ad .RS 14n .rt Supported interfaces are documented in \fBgetspnam\fR(3C). .RE .sp .LP The \fBgetent\fR command can also be used to fetch entries from automount maps, by specifying the following value for \fIdatabase\fR: .sp .in +2 .nf automount/\fImap\fR .fi .in -2 .sp .sp .LP In this case, \fBgetent\fR retrieves the contents of \fImap\fR from the sources listed for \fBautomount\fR in \fBnsswitch.conf\fR(5). As with other databases, one or more specific search keys can be passed. .sp .LP Each \fIkey\fR must be in a format appropriate for searching on the respective database. For example, it can be a \fIusername\fR or \fInumeric-uid\fR for \fBpasswd\fR; \fIhostname\fR or \fIIP-address\fR for \fBhosts\fR; or \fIservice\fR, \fIservice/protocol\fR, \fIport\fR, or \fIport/proto\fR for \fBservices\fR. .sp .LP \fBgetent\fR prints each entry from the specified \fIdatabase\fR that matches each specified \fIkey\fR, one per line, in the format of the matching administrative file: \fBpasswd\fR(5), \fBgroup\fR(5), \fBproject\fR(5), \fBnetworks\fR(5), \fBnetmasks\fR(5), \fBuser_attr\fR(5), \fBprof_attr\fR(5), \fBauth_attr\fR(5), or \fBexec_attr\fR(5), or an automount map file as described in \fBautomount\fR(8). The \fIkey\fR for \fBexec_attr\fR(5) is a profile name. If no \fIkey\fR is given, all entries returned by the corresponding enumeration library routine (such as \fBgetpwent()\fR or \fBgethostent()\fR) are printed. Enumeration is not supported on \fBipnodes\fR, \fBethers\fR, \fBnetgroup\fR, or \fBnetmasks\fR. .sp .LP For \fBnetgroup\fR, either specify the netgroup name or specify the netgroup name plus the triples (\fIhostname\fR, \fIusername\fR, and \fIdomainname\fR) specified as keys. The \fBgetent\fR command displays each triple that matches the netgroup name or each triple that matches the specified netgroup name and triple. The asterisk (\fB*\fR) can be used as a wildcard in triples. Note that you might need to escape asterisks. .SS "Key Interpretation for \fBpasswd\fR, \fBgroup\fR, and \fBuser_attr\fR Databases" .sp .LP When \fBgetent\fR is invoked with \fIdatabase\fR set to \fBpasswd\fR, each \fIkey\fR value is processed as follows: .RS +4 .TP .ie t \(bu .el o If the \fIkey\fR value consists only of numeric characters, \fBgetent\fR assumes that the \fIkey\fR value is a numeric user ID and searches the \fBuser\fR database for a matching user ID. .RE .RS +4 .TP .ie t \(bu .el o If the user ID is not found in the user database or if the \fIkey\fR value contains any non-numeric characters, \fBgetent\fR assumes the \fIkey\fR value is a user name and searches the \fBuser\fR database for a matching user name. .RE .sp .LP Similarly, when \fBgetent\fR is invoked with \fIdatabase\fR set to \fBgroup\fR, each \fIkey\fR value is processed as follows: .RS +4 .TP .ie t \(bu .el o If the \fIkey\fR value consists only of numeric characters, \fBgetent\fR assumes that the \fIkey\fR value is a numeric group ID and searches the \fBgroup\fR database for a matching group ID. .RE .RS +4 .TP .ie t \(bu .el o If the group ID is not found in the \fBgroup\fR database or if the \fIkey\fR value contains any non-numeric characters, \fBgetent\fR assumes the \fIkey\fR value is a group name and searches the \fBgroup\fR database for a matching group name. .RE .sp .LP When \fBgetent\fR is invoked with \fIdatabase\fR set to \fBuser_attr\fR, each \fIkey\fR value is processed as follows: .RS +4 .TP .ie t \(bu .el o If the \fIkey\fR value consists only of numeric characters, \fBgetent\fR assumes that the \fIkey\fR value is a numeric user ID and searches the \fBuser\fR database for a matching user ID. .RE .RS +4 .TP .ie t \(bu .el o If the \fIkey\fR value contains any non-numeric characters, \fBgetent\fR assumes the \fIkey\fR value is a user name and searches the \fBuser\fR database for a matching user name. .RE .SH EXAMPLES .LP \fBExample 1\fR Listing the Contents of a Database .sp .LP The following example lists the entire contents of the \fBprotocols\fR database. .sp .in +2 .nf $ \fBgetent protocols\fR .fi .in -2 .sp .LP \fBExample 2\fR Listing the Contents of an Automount Map .sp .LP The following example lists the entire contents of the \fBauto_master\fR automount map. .sp .in +2 .nf $ \fBgetent automount/auto_master\fR .fi .in -2 .sp .LP \fBExample 3\fR Displaying the Entries for a User in the \fBauto_home\fR Automount Map .sp .LP The following example displays the entry for user \fIusername\fR in the \fBauto_home\fR automount map. .sp .in +2 .nf $ \fBgetent automount/auto_home \fIusername\fR\fR .fi .in -2 .sp .LP \fBExample 4\fR Displaying \fBnetgroup\fR Triples .sp .LP The following example output displays triples that match the specified netgroup name (\fBworkstations\fR) and triple. Wildcards (\fB*\fR) can be specified in the triple. .sp .LP A match is shown as the netgroup triple equal to 1. .sp .in +2 .nf $ \fBgetent netgroup workstations \fIhostname\fR \* \*\fR workstations (\fIhostname\fR,*,*) = 1 .fi .in -2 .sp .SH EXIT STATUS .sp .LP The following exit values are returned: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 5n .rt Successful completion. .RE .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .RS 5n .rt Command syntax was incorrect, an invalid option was used, or an internal error occurred. .RE .sp .ne 2 .mk .na \fB\fB2\fR\fR .ad .RS 5n .rt At least one of the specified entry names was not found in the database. .RE .sp .ne 2 .mk .na \fB\fB3\fR\fR .ad .RS 5n .rt There is no support for enumeration on this database. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Availability system/core-os _ Interface Stability Committed .TE .sp .SH SEE ALSO .sp .LP \%\fBethers\fR(3C), \%\fBgetauthattr\fR(3C), \%\fBgetexecattr\fR(3C), \%\fBgetgrnam\fR(3C), \%\fBgetgrouplist\fR(3C), \%\fBgethostbyaddr\fR(3C), \%\fBgethostbyname\fR(3C), \%\fBgethostent\fR(3C), \%\fBgetipnodebyaddr\fR(3C), \%\fBgetipnodebyname\fR(3C), \%\fBgetnetbyname\fR(3C), \%\fBgetnetgrent\fR(3C), \%\fBgetprofattr\fR(3C), \%\fBgetprotobyname\fR(3C), \%\fBgetpwnam\fR(3C), \%\fBgetservbyname\fR(3C), \%\fBgetspnam\fR(3C), \%\fBgetuserattr\fR(3C), \%\fBgetprojbyname\fR(3PROJECT), \%\fBgetrpcbyname\fR(3C), \%\fBauth_attr\fR(5), \%\fBethers\fR(5), \%\fBexec_attr\fR(5), \%\fBgroup\fR(5), \%\fBhosts\fR(5), \%\fBnetgroup\fR(5), \%\fBnetmasks\fR(5), \%\fBnetworks\fR(5), \%\fBnsswitch.conf\fR(5), \%\fBpasswd\fR(5), \%\fBprof_attr\fR(5), \%\fBproject\fR(5), \%\fBprotocols\fR(5), \%\fBrpc\fR(5), \%\fBservices\fR(5), \%\fBshadow\fR(5), \%\fBuser_attr\fR(5), \%\fBautomount\fR(8)