2006-05-04 08:44:44 +00:00
|
|
|
.\" $NetBSD: getent.1,v 1.13 2005/09/11 23:16:15 wiz Exp $
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2004 The NetBSD Foundation, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Luke Mewburn.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
|
|
|
.Dd August 24, 2005
|
|
|
|
.Dt GETENT 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm getent
|
|
|
|
.Nd get entries from administrative database
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Ar database
|
|
|
|
.Op Ar key ...
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2006-09-30 17:27:50 +00:00
|
|
|
utility retrieves and displays entries from the administrative
|
2006-05-04 08:44:44 +00:00
|
|
|
database specified by
|
|
|
|
.Ar database ,
|
|
|
|
using the lookup order specified in
|
|
|
|
.Xr nsswitch.conf 5 .
|
|
|
|
The display format for a given
|
|
|
|
.Ar database
|
|
|
|
is as per the
|
|
|
|
.Dq traditional
|
|
|
|
file format for that database.
|
|
|
|
.Pp
|
2006-09-30 17:27:50 +00:00
|
|
|
The
|
2006-05-04 08:44:44 +00:00
|
|
|
.Ar database
|
2006-09-30 17:27:50 +00:00
|
|
|
argument may be one of:
|
|
|
|
.Pp
|
|
|
|
.Bl -column ".Li netgroup" -offset indent -compact
|
2006-05-04 08:44:44 +00:00
|
|
|
.Sy Database Ta Sy Display format
|
2006-09-30 17:27:50 +00:00
|
|
|
.It Li ethers Ta address name
|
|
|
|
.It Li group Ta group:passwd:gid:[member[,member]...]
|
|
|
|
.It Li hosts Ta address name [alias ...]
|
|
|
|
.It Li networks Ta name network [alias ...]
|
|
|
|
.It Li passwd Ta user:passwd:uid:gid:gecos:home_dir:shell
|
|
|
|
.It Li protocols Ta name protocol [alias ...]
|
|
|
|
.It Li rpc Ta name number [alias ...]
|
|
|
|
.It Li services Ta name port/protocol [alias ...]
|
|
|
|
.It Li shells Ta /path/to/shell
|
2010-01-13 18:08:00 +00:00
|
|
|
.It Li utmpx Ta [time] type: properties
|
2006-05-04 08:44:44 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
If one or more
|
|
|
|
.Ar key
|
|
|
|
arguments are provided, they will be looked up in
|
|
|
|
.Ar database
|
|
|
|
using the appropriate function.
|
|
|
|
For example,
|
2006-09-30 17:27:50 +00:00
|
|
|
.Dq Li passwd
|
2006-05-04 08:44:44 +00:00
|
|
|
supports a numeric UID or user name;
|
2006-09-30 17:27:50 +00:00
|
|
|
.Dq Li hosts
|
2006-05-04 08:44:44 +00:00
|
|
|
supports an IPv4 address, IPv6 address, or host name;
|
|
|
|
and
|
2006-09-30 17:27:50 +00:00
|
|
|
.Dq Li services
|
2006-05-04 08:44:44 +00:00
|
|
|
supports a service name, service name/protocol name, numeric port, or
|
|
|
|
numeric port/protocol name.
|
|
|
|
.Pp
|
|
|
|
If no
|
|
|
|
.Ar key
|
|
|
|
is provided and
|
|
|
|
.Ar database
|
|
|
|
supports enumeration, all entries for
|
|
|
|
.Ar database
|
|
|
|
will be retrieved using the appropriate enumeration function and printed.
|
2006-09-30 17:27:50 +00:00
|
|
|
.Sh EXIT STATUS
|
|
|
|
The
|
2006-05-04 08:44:44 +00:00
|
|
|
.Nm
|
2006-09-30 17:27:50 +00:00
|
|
|
utility exits 0 on success,
|
2006-05-04 08:44:44 +00:00
|
|
|
1 if there was an error in the command syntax,
|
|
|
|
2 if one of the specified key names was not found in
|
|
|
|
.Ar database ,
|
|
|
|
or 3 if there is no support for enumeration on
|
|
|
|
.Ar database .
|
|
|
|
.Sh SEE ALSO
|
2010-01-13 18:08:00 +00:00
|
|
|
.Xr getutxent 3 ,
|
2006-05-04 08:44:44 +00:00
|
|
|
.Xr ethers 5 ,
|
|
|
|
.Xr group 5 ,
|
|
|
|
.Xr hosts 5 ,
|
|
|
|
.Xr networks 5 ,
|
|
|
|
.Xr nsswitch.conf 5 ,
|
|
|
|
.Xr passwd 5 ,
|
|
|
|
.Xr protocols 5 ,
|
|
|
|
.Xr rpc 5 ,
|
|
|
|
.Xr services 5 ,
|
|
|
|
.Xr shells 5
|
|
|
|
.Sh HISTORY
|
|
|
|
A
|
|
|
|
.Nm
|
|
|
|
command appeared in
|
|
|
|
.Nx 3.0 ,
|
2006-09-30 17:27:50 +00:00
|
|
|
and was imported into
|
2006-05-04 08:44:44 +00:00
|
|
|
.Fx 7.0 .
|
|
|
|
It was based on the command of the same name in
|
|
|
|
.Tn Solaris
|
|
|
|
and
|
|
|
|
.Tn Linux .
|