Content-type: text/html Man page of ypmatch


Section: User Commands (1)
Index Return to Main Contents


ypmatch - print the value of one or more keys from an NIS map  


ypmatch [-d domain] [-k] [-t] key... mname

ypmatch -x



Displays key values for specified domain. Displays key, followed by a colon (:), before displaying value of the key. This is useful if the keys are not duplicated in the returned values, or if the number of specified keys is so large that the output is confusing. Inhibits translation of nickname to mapname. For example, ypmatch -t zippy passwd

fails because there is no map named passwd, while ypmatch zippy passwd
succeeds because ypmatch translates it to ypmatch zippy passwd.byname. Displays map nickname table. This option tells ypmatch to list the nicknames (mnames) with their associated mapnames.


The ypmatch command prints the values associated with one or more keys from the Network Information Service (NIS) map (database) specified by mname, which may be either a mapname or a map nickname.

Multiple keys can be specified. After the key values and the map name have been specified, ypmatch searches the map for all of the specified keys. The specified keys must be exact values in terms of capitalization and length. The ypmatch command does not have a pattern matching capability. If ypmatch cannot match a key, it produces a diagnostic message.

The default list of mapnames served by NIS is as follows: passwd.byname, passwd.byuid, group.byname, group.byuid, hosts.byname, hosts.byaddr, networks.byname, networks.byaddr, services.byname, rpc.bynumber, protocols.byname, protocols.bynumber, netgroup.byuser, netgroup.byhost, mail.alias.


The following are sample command lines that illustrate how to use the ypmatch command to access information in each of the maps:

MapnameSample command

passwd.bynameypmatch user1 passwd.byname
passwd.byuidypmatch uid1 passwd.byuid
group.bynameypmatch group1 group.byname
group.byuidypmatch gid1 group.bygid
hosts.bynameypmatch host1 host.byname
hosts.byaddrypmatch hostaddr1 hosts.byaddr
networks.bynameypmatch network1 networks.byname
networks.byaddrypmatch netaddr1 networks.byaddr
services.bynameypmatch servport/tcp services.byname
rpc.bynumberypmatch rpcnum rpc.bynumber
protocols.bynameypmatch proto1 protocols.byname
protocols.bynumberypmatch protonum1 protocols.bynumber
netgroup.byuserypmatch user1 netgroup.byuser
netgroup.byhostypmatch host1 netgroup.byhost
mail.aliasypmatch mailgroup1 mail.alias



ypfiles(4), ypcat(1)

Network Administration




This document was created by man2html, using the manual pages.
Time: 02:43:03 GMT, October 02, 2010