2009-03-15 18:19:57 +03:00
|
|
|
.\" $NetBSD: getent.1,v 1.19 2009/03/15 15:19:57 joerg Exp $
|
2004-11-23 10:35:06 +03:00
|
|
|
.\"
|
|
|
|
.\" 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.
|
|
|
|
.\"
|
2008-05-14 15:44:09 +04:00
|
|
|
.Dd May 14, 2008
|
2004-11-23 10:35:06 +03:00
|
|
|
.Dt GETENT 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm getent
|
|
|
|
.Nd get entries from administrative database
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Ar database
|
2004-11-23 12:06:24 +03:00
|
|
|
.Op Ar key ...
|
2004-11-23 10:35:06 +03:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
program retrieves and displays entries from the administrative
|
|
|
|
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
|
|
|
|
.Ar database
|
|
|
|
may be one of:
|
2009-03-15 18:19:57 +03:00
|
|
|
.Bl -column "protocols" "user:passwd:uid:gid:gecos:home_dir:shell" -offset indent -compact
|
2009-03-11 16:53:09 +03:00
|
|
|
.It Sy Database Ta Sy Display format
|
2008-02-02 01:39:20 +03:00
|
|
|
.It disktab Ta entry
|
2005-08-24 18:31:02 +04:00
|
|
|
.It ethers Ta address name
|
2008-02-04 18:30:44 +03:00
|
|
|
.It gettytab Ta entry
|
2004-11-23 10:35:06 +03:00
|
|
|
.It group Ta group:passwd:gid:[member[,member]...]
|
2004-11-29 07:13:15 +03:00
|
|
|
.It hosts Ta address name [alias ...]
|
2008-05-14 15:44:09 +04:00
|
|
|
.It netgroup Ta (host,user,domain) [...]
|
2004-11-26 07:52:45 +03:00
|
|
|
.It networks Ta name network [alias ...]
|
2005-09-12 03:16:15 +04:00
|
|
|
.It passwd Ta user:passwd:uid:gid:gecos:home_dir:shell
|
2008-02-02 01:39:20 +03:00
|
|
|
.It printcap Ta entry
|
2004-11-26 08:07:12 +03:00
|
|
|
.It protocols Ta name protocol [alias ...]
|
2005-01-21 05:43:33 +03:00
|
|
|
.It rpc Ta name number [alias ...]
|
2004-11-29 07:13:15 +03:00
|
|
|
.It services Ta name port/protocol [alias ...]
|
2004-11-23 10:35:06 +03:00
|
|
|
.It shells Ta /path/to/shell
|
2008-02-02 01:39:20 +03:00
|
|
|
.It termcap Ta entry
|
2004-11-23 10:35:06 +03:00
|
|
|
.El
|
|
|
|
.Pp
|
2004-11-24 19:37:44 +03:00
|
|
|
If one or more
|
2004-11-23 10:35:06 +03:00
|
|
|
.Ar key
|
|
|
|
arguments are provided, they will be looked up in
|
|
|
|
.Ar database
|
|
|
|
using the appropriate function.
|
|
|
|
For example,
|
|
|
|
.Sy passwd
|
2005-08-24 18:46:59 +04:00
|
|
|
supports a numeric UID or user name;
|
2004-11-23 10:35:06 +03:00
|
|
|
.Sy hosts
|
2005-08-24 18:46:59 +04:00
|
|
|
supports an IPv4 address, IPv6 address, or host name;
|
|
|
|
and
|
|
|
|
.Sy services
|
|
|
|
supports a service name, service name/protocol name, numeric port, or
|
|
|
|
numeric port/protocol name.
|
2004-11-23 10:35:06 +03:00
|
|
|
.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.
|
2008-02-02 01:39:20 +03:00
|
|
|
.Pp
|
|
|
|
For
|
|
|
|
.Xr cgetcap 3
|
|
|
|
style databases (
|
|
|
|
.Sy disktab ,
|
|
|
|
.Sy printcap ,
|
|
|
|
.Sy termcap )
|
|
|
|
specifying a key, lists the entry for that key, and specifying more arguments
|
|
|
|
after the key are used as fields in that key, and only the values of the keys
|
|
|
|
are returned.
|
|
|
|
For boolean keys
|
|
|
|
.Dv true
|
|
|
|
is returned if the key is found. If a key is not found, then
|
|
|
|
.Dv false
|
|
|
|
is always
|
|
|
|
returned.
|
2004-11-23 10:35:06 +03:00
|
|
|
.Sh DIAGNOSTICS
|
|
|
|
.Nm
|
|
|
|
exits 0 on success,
|
|
|
|
1 if there was an error in the command syntax,
|
2004-11-26 07:52:45 +03:00
|
|
|
2 if one of the specified key names was not found in
|
2004-11-23 10:35:06 +03:00
|
|
|
.Ar database ,
|
|
|
|
or 3 if there is no support for enumeration on
|
|
|
|
.Ar database .
|
|
|
|
.Sh SEE ALSO
|
2008-02-02 01:39:20 +03:00
|
|
|
.Xr cgetcap 3 ,
|
2008-02-04 18:30:44 +03:00
|
|
|
.Xr disktab 5 ,
|
2005-08-24 18:31:02 +04:00
|
|
|
.Xr ethers 5 ,
|
2008-02-04 18:30:44 +03:00
|
|
|
.Xr gettytab 5 ,
|
2004-11-26 07:52:45 +03:00
|
|
|
.Xr group 5 ,
|
|
|
|
.Xr hosts 5 ,
|
|
|
|
.Xr networks 5 ,
|
|
|
|
.Xr nsswitch.conf 5 ,
|
|
|
|
.Xr passwd 5 ,
|
2004-11-26 08:07:12 +03:00
|
|
|
.Xr protocols 5 ,
|
2008-02-04 18:30:44 +03:00
|
|
|
.Xr printcap 5 ,
|
2005-01-21 05:43:33 +03:00
|
|
|
.Xr rpc 5 ,
|
2004-11-29 07:13:15 +03:00
|
|
|
.Xr services 5 ,
|
2008-02-04 18:30:44 +03:00
|
|
|
.Xr shells 5 ,
|
|
|
|
.Xr termcap 5
|
2004-11-23 10:35:06 +03:00
|
|
|
.Sh HISTORY
|
|
|
|
A
|
|
|
|
.Nm
|
|
|
|
command appeared in
|
|
|
|
.Nx 3.0 .
|
2004-12-04 02:05:32 +03:00
|
|
|
It was based on the command of the same name in
|
|
|
|
.Tn Solaris
|
|
|
|
and
|
|
|
|
.Tn Linux .
|