Description ldapsearch
queries an LDAP directory and returns the results.
Syntax
ldapsearch [options] filter [attributes] -d
Parameter |
Description |
---|---|
|
See the |
|
RFC-1558 compliant LDAP search filter. For example,
|
|
The list of attributes to be retrieved. If no attributes are given, all attributes are retrieved. |
|
Debug flag. |
The following are the attributes for options:
-A -
Retrieve attribute names only (without values).-B -
Do not suppress printing of non-ASCII values.-D bindDN -
The DN to be used for binding to the LDAP server.-F separator -
Print separator
between attribute name and value instead of "=
".-h host -
The LDAP server identified by IP address or resolvable name.-l timelimit -
The server side time limit for search, in seconds.-p portnum -
The port number. The default is standard LDAP port 389.-S attribute -
Sort the results by the values of attribute.
-s scope -
One of the following: "base
", "one
", "sub
".-b -
Base distinguished name (DN) for search.-t -
Write values to files in /tmp
. Each attribute-value pair is written to a separate file, named: /tmp/ldapsearch-<attribute>-<value>
.fw1color
attribute, the file written is named./tmp/ldapsearch-fw1color-a00188.
-T timeout -
Client-side timeout (in milliseconds) for all operations.-u -
Show "user friendly" entry names in the output. For example, show "cn=Babs Jensen, users, omi
" instead of "cn=Babs Jensen, cn=users,cn=omi
"-w password -
The password.-Z -
Encrypt using SSL.-z sizelimit -
Server-side size limit for search, in entries.Example ldapsearch -p 18185 -b cn=omi objectclass=fw1host objectclass
This means that the LDAP directory will be queried for fw1host
objects using port number 18185 with DN common name "omi
". For each object found, the value of its objectclass
attribute will be printed.