6330N/A<?xml version="1.0" encoding="UTF-8"?>
6330N/A<!--
6330N/A ! CCPL HEADER START
6330N/A !
6330N/A ! This work is licensed under the Creative Commons
6330N/A ! Attribution-NonCommercial-NoDerivs 3.0 Unported License.
6330N/A ! To view a copy of this license, visit
6330N/A ! http://creativecommons.org/licenses/by-nc-nd/3.0/
6330N/A ! or send a letter to Creative Commons, 444 Castro Street,
6330N/A ! Suite 900, Mountain View, California, 94041, USA.
6330N/A !
6330N/A ! You can also obtain a copy of the license at
6330N/A ! trunk/opendj3/legal-notices/CC-BY-NC-ND.txt.
6330N/A ! See the License for the specific language governing permissions
6330N/A ! and limitations under the License.
6330N/A !
6330N/A ! If applicable, add the following below this CCPL HEADER, with the fields
6330N/A ! enclosed by brackets "[]" replaced with your own identifying information:
6330N/A ! Portions Copyright [yyyy] [name of copyright owner]
6330N/A !
6330N/A ! CCPL HEADER END
6330N/A !
6330N/A ! Copyright 2011-2012 ForgeRock AS
6330N/A ! Portions Copyright 2013 Jens Elkner
6330N/A !
6330N/A-->
6330N/A<refentry xml:id="ldifsearch-1" xmlns="http://docbook.org/ns/docbook"
6330N/A version="5.0" xml:lang="en"
6330N/A xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6330N/A xsi:schemaLocation="http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd"
6330N/A xmlns:xlink="http://www.w3.org/1999/xlink"
6330N/A xmlns:xi="http://www.w3.org/2001/XInclude">
6330N/A <xi:include href="common.xml" xpointer='xpointer(//info[@name="info"])'/>
6330N/A <refmeta>
6330N/A <refentrytitle><application>ldifsearch</application></refentrytitle>
6330N/A <xi:include href="common.xml" xpointer='xpointer(//manvolnum[@name="v1m"])'/>
6330N/A </refmeta>
6330N/A <refnamediv>
6330N/A <refname><application>ldifsearch</application></refname>
6330N/A <refpurpose>search LDIF with LDAP filters</refpurpose>
6330N/A </refnamediv>
6330N/A <refsynopsisdiv>
6330N/A <cmdsynopsis>
6330N/A <command>ldifsearch</command>
6330N/A <arg>-O</arg>
6331N/A <arg>-t</arg>
6330N/A <arg>-b <replaceable class="parameter">baseDN</replaceable></arg>
6330N/A <arg>-l <replaceable class="parameter">searchFile</replaceable></arg>
6330N/A <arg>-f <replaceable class="parameter">filterFile</replaceable></arg>
6330N/A <arg>-o <replaceable class="parameter">outfile</replaceable></arg>
6330N/A <arg>-s <replaceable class="parameter">searchScope</replaceable></arg>
6331N/A <arg>-L <replaceable class="parameter">seconds</replaceable></arg>
6330N/A <arg>-z <replaceable class="parameter">entries</replaceable></arg>
6330N/A <xi:include href="common.xml"
6330N/A xpointer='xpointer(//para[@name="s-general"]/*)'/>
6330N/A <sbr/><sbr/>
6330N/A <arg choice="opt">filter</arg>
6330N/A <arg choice="opt" rep="repeat">attribute</arg>
6330N/A </cmdsynopsis>
6330N/A </refsynopsisdiv>
6330N/A <refsection>
6330N/A <title>Description</title>
6330N/A <para>
6330N/AThis utility can be used to perform search operations against data in an LDIF
6330N/Afile.
6330N/A </para>
6330N/A <variablelist>
6330N/A <varlistentry>
6330N/A <term>filter</term>
6330N/A <listitem>
6330N/A <para>
6330N/AThe filter argument is a string representation of an LDAP search filter as in
6330N/A(cn=Babs Jensen), (&amp;(objectClass=Person)(|(sn=Jensen)(cn=Babs J*))), or
6330N/A(cn:caseExactMatch:=Fred Flintstone).
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A <varlistentry>
6330N/A <term>attribute</term>
6330N/A <listitem>
6330N/A <para>
6330N/AThe optional attribute list specifies the attributes to return in the entries
6330N/Afound by the search. In addition to identifying attributes by name such as cn
6330N/Asn mail and so forth, you can use the following notations, too.
6330N/A </para>
6330N/A <variablelist>
6330N/A <varlistentry>
6330N/A <term>*</term>
6330N/A <listitem>
6330N/A <para>
6330N/AReturn all user attributes such as cn, sn, and mail.
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A <varlistentry>
6330N/A <term>+</term>
6330N/A <listitem>
6330N/A <para>
6330N/AReturn all operational attributes such as etag and pwdPolicySubentry.
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A <varlistentry>
6330N/A <term>@<replaceable class="parameter">objectclass</replaceable></term>
6330N/A <listitem>
6330N/A <para>
6330N/AReturn all attributes of the specified object class, where <replaceable
6330N/A>objectclass</replaceable> is one of the object classes on the entries returned
6330N/Aby the search.
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A </variablelist>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A </variablelist>
6330N/A </refsection>
6330N/A <refsection>
6330N/A <title>Options</title>
6330N/A <para>
6330N/AThe following options are supported.
6330N/A </para>
6330N/A <variablelist>
6330N/A <varlistentry>
6330N/A <term><option>-b, --baseDN</option> <replaceable
6330N/A class="parameter">baseDN</replaceable></term>
6330N/A <listitem>
6330N/A <para>
6330N/ASearch base DN. Multiple files may be specified by providing the option multiple
6330N/Atimes.
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A <varlistentry>
6330N/A <term><option>-l, --ldifFile </option> <replaceable
6330N/A class="parameter">file</replaceable></term>
6330N/A <listitem>
6330N/A <para>
6330N/ALDIF file containing the data to search. Multiple files may be specified by
6330N/Aproviding the option multiple times. If no files are provided, the data will
6330N/Abe read from standard input.
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A <varlistentry>
6330N/A <term><option>-f, --filterFile</option> <replaceable
6330N/A class="parameter">file</replaceable></term>
6330N/A <listitem>
6330N/A <para>
6330N/AFile containing a list of search filter strings. If this is not provided, then
6330N/Athe filter must be provided on the command line after all configuration options.
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A <varlistentry>
6330N/A <term><option>-o, --outputFile</option> <replaceable
6330N/A class="parameter">file</replaceable></term>
6330N/A <listitem>
6330N/A <para>
6330N/AWrite search results to <replaceable>file</replaceable> instead of stdout.
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A <varlistentry>
6330N/A <term><option>-O, --overwriteExisting</option></term>
6330N/A <listitem>
6330N/A <para>
6330N/AAny existing output file should be overwritten rather than appending to it.
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A <varlistentry>
6330N/A <term><option>-s, --searchScope</option> <replaceable
6330N/A class="parameter">scope</replaceable></term>
6330N/A <listitem>
6330N/A <para>
6330N/ASearch scope: 'base', 'one', 'sub', or 'subordinate' (Default: sub).
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A <varlistentry>
6331N/A <term><option>-L, --timeLimit</option> <replaceable
6330N/A class="parameter">seconds</replaceable></term>
6330N/A <listitem>
6330N/A <para>
6330N/AMaximum length of time in seconds to allow for the search (Default: 0).
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A <varlistentry>
6330N/A <term><option>-z, --sizeLimit</option> <replaceable
6330N/A class="parameter">entries</replaceable></term>
6330N/A <listitem>
6330N/A <para>
6330N/AMaximum number of matching entries to return from the search (Default: 0).
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A </variablelist>
6330N/A <refsection>
6330N/A <title>Utility Input/Output Options</title>
6330N/A <variablelist>
6330N/A <varlistentry>
6331N/A <term><option>-t, --dontWrap</option></term>
6330N/A <listitem>
6330N/A <para>
6330N/A Do not wrap long lines.
6330N/A </para>
6330N/A </listitem>
6330N/A </varlistentry>
6330N/A </variablelist>
6330N/A </refsection>
6330N/A <refsection>
6330N/A <title>General Options</title>
6330N/A <variablelist>
6330N/A <xi:include href="common.xml"
6330N/A xpointer='xpointer(//para[@name="l-general"]/*)'/>
6330N/A </variablelist>
6330N/A </refsection>
6330N/A </refsection>
6330N/A <refsection>
6330N/A <title>Examples</title>
6330N/A <informalexample>
6330N/A <para>
6330N/AThe following example demonstrates use of the command.
6330N/A </para>
6330N/A <literallayout><prompt
6330N/A>$ </prompt><command>ldifsearch -b dc=example,dc=com -l /tmp/Example.ldif uid=bjensen</command></literallayout>
6330N/A <screen>
6330N/Adn: uid=bjensen,ou=People,dc=example,dc=com
6330N/AobjectClass: person
6330N/AobjectClass: organizationalPerson
6330N/AobjectClass: inetOrgPerson
6330N/AobjectClass: posixAccount
6330N/AobjectClass: top
6330N/Auid: bjensen
6330N/Auserpassword: hifalutin
6330N/Afacsimiletelephonenumber: +1 408 555 1992
6330N/Agivenname: Barbara
6330N/Acn: Barbara Jensen
6330N/Acn: Babs Jensen
6330N/Atelephonenumber: +1 408 555 1862
6330N/Asn: Jensen
6330N/Aroomnumber: 0209
6330N/AhomeDirectory: /home/bjensen
6330N/Amail: bjensen@example.com
6330N/Al: Cupertino
6330N/Aou: Product Development
6330N/Aou: People
6330N/AuidNumber: 1076
6330N/AgidNumber: 1000
6330N/A</screen>
6330N/A </informalexample>
6330N/A
6330N/A <informalexample>
6330N/A <para>
6330N/AYou can also use @<replaceable>objectclass</replaceable> notation in the
6330N/Aattribute list to return the attributes of a particular object class. The
6330N/Afollowing example shows how to return attributes of the
6330N/A<code>posixAccount</code> object class.
6330N/A </para>
6330N/A <literallayout><prompt
6330N/A>$ </prompt><command>ldifsearch -b dc=example,dc=com -l /tmp/Example.ldif \
6330N/A "(uid=bjensen)" @posixaccount</command></literallayout>
6330N/A <screen>
6330N/Adn: uid=bjensen,ou=People,dc=example,dc=com
6330N/AobjectClass: person
6330N/AobjectClass: organizationalPerson
6330N/AobjectClass: inetOrgPerson
6330N/AobjectClass: posixAccount
6330N/AobjectClass: top
6330N/Auid: bjensen
6330N/Auserpassword: hifalutin
6330N/Acn: Barbara Jensen
6330N/Acn: Babs Jensen
6330N/AhomeDirectory: /home/bjensen
6330N/AuidNumber: 1076
6330N/AgidNumber: 1000
6330N/A</screen>
6330N/A </informalexample>
6330N/A </refsection>
6330N/A <xi:include href="common.xml" xpointer='xpointer(//refsection[@name="env"])'/>
6330N/A <xi:include href="common.xml" xpointer='xpointer(//refsection[@name="exit-0-gt0"])'/>
6330N/A <xi:include href="common.xml" xpointer='xpointer(//refsection[@name="seeAlso"])'/>
6330N/A</refentry>