You can use the LDIF delete directive to delete a specific attribute value from an attribute. For this example, assuming you have multiple values of cn in an entry (e.g., cn: Sally Tree, cn: Sally Tea Tree).

  • Use ldapmodify to delete a specific attribute of a multi-valued pair, then specify the attribute pair that you want to delete. In this example, we keep cn:Sally Tree and delete the cn: Sally Tea Tree.
    $ bin/ldapmodify -h server.example.com -p 389 -D "cn=admin,dc=example,dc=com" \
      -w password
    dn: uid=user.2004,ou=People,dc=example,dc=com 
    changetype: modify 
    delete: cn 
    cn: Sally Tea Tree