ldifsearch
Prev | Directory Server Tools | Next

## Name

ldifsearch — search LDIF with LDAP filters

## Synopsis

`ldifsearch` source filter [attributes ...]

## Description

This utility can be used to perform search operations against entries contained in an LDIF file.

If standard input is used to specify source, end your input with EOF (Ctrl+D on UNIX, Ctrl+Z on Windows).

## Options

The ldifsearch command takes the following options:

Command options:

`-A | --typesOnly`

  Only retrieve attribute names but not their values.

  Default: false

`-b | --baseDN {baseDN}`

  The base DN for the search. If no base DN is provided, then the root DSE will be used.

  Default:

`-l | --timeLimit {timeLimit}`

  Maximum length of time in seconds to allow for the search.

  Default: 0

`-o | --outputLDIF {file}`

  Write search results to {file} instead of stdout.

  Default: stdout

`-s | --searchScope {searchScope}`

  Search scope ('base', 'one', 'sub', or 'subordinates'). Note: 'subordinates' is an LDAP extension that might not work with all LDAP servers.

  Default: sub

`-z | --sizeLimit {sizeLimit}`

  Maximum number of entries to return from the search.

  Default: 0

Utility input/output options:

`-t | --wrapColumn {wrapColumn}`

  Maximum length of an output line (0 for no wrapping).

  Default: 0

General options:

`-V | --version`

  Display Directory Server version information.

  Default: false

`-H | --help`

  Display this usage information.

  Default: false

## Exit Codes

0

  The command completed successfully.

> 0

  An error occurred.

## Examples

The following example demonstrates use of the command.

    $ ldifsearch -b dc=example,dc=com Example.ldif uid=bjensen
    dn: uid=bjensen,ou=People,dc=example,dc=com
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    objectClass: posixAccount
    objectClass: top
    uid: bjensen
    userpassword: hifalutin
    facsimiletelephonenumber: +1 408 555 1992
    givenname: Barbara
    cn: Barbara Jensen
    cn: Babs Jensen
    telephonenumber: +1 408 555 1862
    sn: Jensen
    roomnumber: 0209
    homeDirectory: /home/bjensen
    mail: bjensen@example.com
    l: San Francisco
    ou: Product Development
    ou: People
    uidNumber: 1076
    gidNumber: 1000

You can also use `@`objectclass`` notation in the attribute list to return the attributes of a particular object class. The following example shows how to return attributes of the `posixAccount` object class.

    $ ldifsearch -b dc=example,dc=com Example.ldif "(uid=bjensen)" @posixaccount
    dn: uid=bjensen,ou=People,dc=example,dc=com
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    objectClass: posixAccount
    objectClass: top
    uid: bjensen
    userpassword: hifalutin
    cn: Barbara Jensen
    cn: Babs Jensen
    homeDirectory: /home/bjensen
    uidNumber: 1076
    gidNumber: 1000

Prev | Up | Next
ldifmodify | Home | list-backends