|Skip Navigation Links|
|Exit Print View|
|Oracle Fusion Middleware Command-Line Usage Guide for Oracle Unified Directory 11g Release 1 (11.1.1)|
The ldifmodify command makes changes to the contents of an LDIF file.
The ldifmodify command can be used to make changes to the contents of an LDIF file. Although similar to the ldapmodify command, the ldifmodify command does not connect to the directory server but rather operates locally on the LDIF file. The command also does not accept change information on standard input. It must read all changes from a file.
To make it possible to operate on very large LDIF files with limited amounts of memory, the following limitations will be enforced on the types of changes that can be made:
No modify DNs. Modify DN operations are not supported. Only add, delete, and modify operations will be allowed.
No concurrent modify or delete operations. It is not possible to modify or delete an entry that is to be added during the course of processing.
All options (with the exception of --help and --version) are required. The ldifmodify command accepts an option in either its short form (for example, -m changeFile) or its long form equivalent (for example, --changesLDIF changeFile).
Specify the path to the file containing the changes to apply. The contents of this file must be in LDIF change format.
Specify the path to the source LDIF file, which contains the data to be updated.
Specify the path to the target LDIF file, which will consist of the data from the source LDIF with all of the specified changes applied.
Display command usage information and exit without attempting to perform any additional processing.
Display the directory server version information and exit rather than attempting to run this command.
The following examples show how to use the directory server commands. See System Requirements and Certification in Oracle Fusion Middleware Installation Guide for Oracle Unified Directory for more information.
Example 4-11 Modifying an LDIF File
Suppose that the source file is as follows:
dn: uid=qcubbins,ou=People,dc=example,dc=com objectclass: top objectclass: person objectclass: organizationalPerson objectclass: inetOrgPerson uid: qcubbins givenName: Quentin sn: Cubbins cn: Quentin Cubbins mail: email@example.com userPassword: qcubbins description: This is Quentin's description.
And suppose that the update (change) file is as follows:
## Add new telephone number for Quentin Cubbins dn: uid=qcubbins,ou=People,dc=example,dc=com changetype: modify add: telephoneNumber telephoneNumber: 512-401-1241
The following command updates a source file (-s) with changes listed in a modify file (-m) and outputs to a target file (-t). For Windows platforms, use the file paths for the modify file (for example, -m \temp\update.ldif), the source file (for example, -s \temp\quentin.ldif), and the target file (for example, -s \temp\quentin_updated.ldif):
$ ldifmodify -m /usr/local/update.ldif -s /usr/local/quentin.ldif \ -t /usr/local/quentin_updated.ldif
The updated file is as follows:
dn: uid=qcubbins,ou=People,dc=example,dc=com objectClass: inetOrgPerson objectClass: person objectClass: top objectClass: organizationalPerson sn: Cubbins userPassword: qcubbins description: This is Quentin's description. cn: Quentin Cubbins telephoneNumber: 512-401-1241 givenName: Quentin uid: qcubbins mail: firstname.lastname@example.org
An exit code of 0 indicates that the operation completed successfully. An exit code of 1 or greater indicates that an error occurred during processing.
UNIX and Linux: instance-dir/OUD/bin/ldifmodify