DIRECTORY SERVICES


Using search filters with ldapsearch
You must use a search filter to specify the attributes for which to search. The syntax for a search filter is:
For example, this search filter finds all entries containing Smith as the value for the sn (surname) attribute:
You can specify any attribute stored in a directory in a search filter. The following are common attributes used to search for entries about people:
You can specify search filters on the ldapsearch command line, or you can specify them in a file and use the ldapsearch parameter -f to refer to the file. If you use a file, specify each search filter on a separate line.

Note you can include language tags in a search filter if the LDAP directory, such as the IBM® Lotus® Domino® Directory, supports them. For example:


Multiple search filters with Boolean operators

You can use multiple search filters and Boolean operators. Use this syntax:


For example, use this search filter to find entries with the surname Browning and the location Dallas.
You can nest Boolean operators. For example, use this search filter to find entries with the surname caneel or givenname alfred in the mail domain MDN:
Related topics