NFS Services Administrator's Guide
Configuring and Administering NIS+
Administering NIS+
Chapter 5 239
To Search an NIS+ Table
• Issue one of the following commands from any NIS+ client host:
nisgrep ’column_name=regular_expression’ tablename
nismatch column_name=text_string tablename
For example, the following command returns all the entries from users in
the passwd table whose home directories are under /users:
nisgrep ’home=/users/*’ passwd.org_dir
If you do not specify a column name, the first column of the table is
searched. The following command returns the Local and DES credentials
for NIS+ principal liz.Eng.Wiz.Com. from the cred table:
nismatch liz.Eng.Wiz.Com. cred.org_dir
The nismatch command can search only columns that were defined as
searchable when the table was created. The nisgrep command can
search any column in a table.
To get the name of a column, or to determine whether a column is
searchable, issue the following command:
niscat -o tablename.org_dir
The nisgrep command can search on regular expressions, but the
nismatch command can search only for exact matches of text strings.
The nisgrep command is slower than the nismatch command.
You must have read permission on the table or the entries you are
searching for, or NIS+ will not display the entries.
You can use SAM (System Administration Manager) to search NIS+
tables. To run SAM type sam at the HP-UX prompt.
For more information, see the following man pages: nismatch(1) and
sam(1M).