Chapter 2. Creating Directory Entries

cn=Barney Fife,ou=People,dc=example,dc=com

objectClass: inetOrgPerson

cn: Barney Fife

sn: Fife

telephonenumber: 555-1212

telephonenumber: 555-6789

To delete the 555-1212telephone number from this entry, use the following LDIF update statement:

dn: cn=Barney Fife,ou=People,dc=example,dc=com

changetype: modify

delete: telephonenumber

telephonenumber: 555-1212

Barney's entry then becomes:

cn=Barney Fife,ou=People,dc=example,dc=com

objectClass: inetOrgPerson

cn: Barney Fife

sn: Fife

telephonenumber: 555-6789

4.4. Deleting an Entry Using LDIF

changetype: delete is the change type which deletes an entire entry from the directory.

NOTE

You can only delete leaf entries. Therefore, when you delete an entry, make sure that no other entries exist under that entry in the directory tree. That is, you cannot delete an organizational unit entry unless you have first deleted all the entries that belong to the organizational unit.

For example, of the following three entries, only the last two entries can be deleted:

ou=People,dc=example,dc=com

cn=Paula Simon,ou=People,dc=example,dc=com

cn=Jerry O'Connor,ou=People,dc=example,dc=com

The entry that identifies the People subtree can be deleted only if no other entries exist below it.

The following LDIF update statements can be used to delete person entries:

dn: cn=Pete Minsky,ou=People,dc=example,dc=com

40

Page 60
Image 60
HP UX Red Hat Direry Server Software manual Deleting an Entry Using Ldif, Barneys entry then becomes