Red Hat Directory Server 8.0 Administrator's Guide

Option Description
server. If specified, this value must be a DN
recognized by the Directory Server, and it
must also have the authority to search for the
entries. For example, -D "uid=bjensen,
dc=example,dc=com".
-h Specifies the hostname or IP address of the
machine on which the Directory Server is
installed. For example, -h mozilla. If a host
is not specified, ldapsearch uses the
localhost.
-l Specifies the maximum number of seconds to
wait for a search request to complete. For
example, -l 300. The default value for the
nsslapd-timelimit attribute is 3600
seconds. Regardless of the value specified,
ldapsearch will never wait longer than is
allowed by the server's nsslapd-timelimit
attribute.
-p Specifies the TCP port number that the
Directory Server uses. For example, -p 1049.
The default is 389. If -Z is used, the default is
636.
-s Specifies the scope of the search. The scope
can be one of the following:
base searches only the entry specified in the
-b option or defined by the LDAP_BASEDN
environment variable.
one searches only the immediate children of
the entry specified in the -b option. Only the
children are searched; the actual entry
specified in the -b option is not searched.
sub searches the entry specified in the -b
option and all of its descendants; that is,
perform a subtree search starting at the point
identified in the -b option. This is the default.
-w Gives the password associated with the
distinguished name that is specified in the -D
option. If this option is not specified,
anonymous access is used. For example, -w
diner892.
-x Specifies that the search results are sorted on
the server rather than on the client. This is
Commonly Used ldapsearch Options
555