[BACK]Return to getent.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / getent

Annotation of src/usr.bin/getent/getent.1, Revision 1.10

1.10    ! jmc         1: .\"    $OpenBSD: getent.1,v 1.9 2010/10/01 07:06:16 jmc Exp $
1.1       otto        2: .\"    $NetBSD: getent.1,v 1.13 2005/09/11 23:16:15 wiz Exp $
                      3: .\"
                      4: .\" Copyright (c) 2004 The NetBSD Foundation, Inc.
                      5: .\" All rights reserved.
                      6: .\"
                      7: .\" This code is derived from software contributed to The NetBSD Foundation
                      8: .\" by Luke Mewburn.
                      9: .\"
                     10: .\" Redistribution and use in source and binary forms, with or without
                     11: .\" modification, are permitted provided that the following conditions
                     12: .\" are met:
                     13: .\" 1. Redistributions of source code must retain the above copyright
                     14: .\"    notice, this list of conditions and the following disclaimer.
                     15: .\" 2. Redistributions in binary form must reproduce the above copyright
                     16: .\"    notice, this list of conditions and the following disclaimer in the
                     17: .\"    documentation and/or other materials provided with the distribution.
                     18: .\"
                     19: .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
                     20: .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
                     21: .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
                     22: .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
                     23: .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
                     24: .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
                     25: .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
                     26: .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
                     27: .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
                     28: .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
                     29: .\" POSSIBILITY OF SUCH DAMAGE.
                     30: .\"
1.10    ! jmc        31: .Dd $Mdocdate: October 1 2010 $
1.1       otto       32: .Dt GETENT 1
                     33: .Os
                     34: .Sh NAME
                     35: .Nm getent
                     36: .Nd get entries from administrative database
                     37: .Sh SYNOPSIS
                     38: .Nm
                     39: .Ar database
                     40: .Op Ar key ...
                     41: .Sh DESCRIPTION
                     42: The
                     43: .Nm
                     44: program retrieves and displays entries from the administrative
                     45: database specified by
1.4       jmc        46: .Ar database .
                     47: The order in which entries are looked up
                     48: is defined by the specific database
                     49: (for example, the lookup order for the
                     50: .Dq hosts
                     51: database is determined by
                     52: .Xr resolv.conf 5 ) .
1.1       otto       53: The display format for a given
                     54: .Ar database
                     55: is as per the
                     56: .Dq traditional
                     57: file format for that database.
                     58: .Pp
                     59: .Ar database
                     60: may be one of:
1.10    ! jmc        61: .Bl -column "netgroup" -offset indent
1.7       schwarze   62: .It Sy Database Ta Sy Display format
1.1       otto       63: .It ethers Ta address name
                     64: .It group Ta group:passwd:gid:[member[,member]...]
                     65: .It hosts Ta address name [alias ...]
                     66: .It networks Ta name network [alias ...]
                     67: .It passwd Ta user:passwd:uid:gid:gecos:home_dir:shell
                     68: .It protocols Ta name protocol [alias ...]
                     69: .It rpc Ta name number [alias ...]
                     70: .It services Ta name port/protocol [alias ...]
                     71: .It shells Ta /path/to/shell
                     72: .El
                     73: .Pp
                     74: If one or more
                     75: .Ar key
                     76: arguments are provided, they will be looked up in
                     77: .Ar database
                     78: using the appropriate function.
                     79: For example,
                     80: .Sy passwd
                     81: supports a numeric UID or user name;
                     82: .Sy hosts
                     83: supports an IPv4 address, IPv6 address, or host name;
                     84: and
                     85: .Sy services
                     86: supports a service name, service name/protocol name, numeric port, or
                     87: numeric port/protocol name.
                     88: .Pp
                     89: If no
                     90: .Ar key
                     91: is provided and
                     92: .Ar database
                     93: supports enumeration, all entries for
                     94: .Ar database
                     95: will be retrieved using the appropriate enumeration function and printed.
1.8       jmc        96: .Sh EXIT STATUS
                     97: The
1.1       otto       98: .Nm
1.9       jmc        99: utility exits with one of the following values:
1.8       jmc       100: .Pp
                    101: .Bl -tag -width Ds -offset indent -compact
                    102: .It 0
                    103: Success.
                    104: .It 1
                    105: There was an error in the command syntax.
                    106: .It 2
                    107: One of the specified key names was not found in
1.1       otto      108: .Ar database .
1.8       jmc       109: .It 3
                    110: There is no support for enumeration on
                    111: .Ar database .
                    112: .El
1.1       otto      113: .Sh SEE ALSO
                    114: .Xr ethers 5 ,
                    115: .Xr group 5 ,
                    116: .Xr hosts 5 ,
                    117: .Xr networks 5 ,
                    118: .Xr passwd 5 ,
                    119: .Xr protocols 5 ,
                    120: .Xr rpc 5 ,
                    121: .Xr services 5 ,
                    122: .Xr shells 5
                    123: .Sh HISTORY
                    124: A
                    125: .Nm
1.4       jmc       126: command first appeared in
1.3       otto      127: .Ox 3.9 .
1.1       otto      128: It was based on the command of the same name in
                    129: .Tn Solaris
                    130: and
                    131: .Tn Linux .