nerdexam
Linux_Foundation

LFCS · Question #172

The administrator wants to add the content from an LDIF file named example.ldif to the LDAP directory. Which of the following commands will perform this task?

The correct answer is A. slapadd < example.ldif. To add content from an LDIF file to the LDAP directory using slapadd, the file's content is typically redirected to the command's standard input.

Submitted by weili_xi· Apr 18, 2026Essential Commands

Question

The administrator wants to add the content from an LDIF file named example.ldif to the LDAP directory. Which of the following commands will perform this task?

Options

  • Aslapadd < example.ldif
  • Bslapadd example.ldif
  • Cslapadd -f example.ldif
  • Dslapadd -F example.ldif

How the community answered

(19 responses)
  • A
    95% (18)
  • C
    5% (1)

Why each option

To add content from an LDIF file to the LDAP directory using `slapadd`, the file's content is typically redirected to the command's standard input.

Aslapadd < example.ldifCorrect

The slapadd command, by default, reads the LDIF entries to be added from standard input, making redirection using the '<' operator the correct method to feed the content of example.ldif into the command.

Bslapadd example.ldif

Providing the filename directly as an argument without redirection or a flag is not the standard way for slapadd to read LDIF input.

Cslapadd -f example.ldif

The -f option is used to specify the configuration file for slapd, not the input LDIF file for slapadd.

Dslapadd -F example.ldif

The -F option is used to specify the configuration directory for slapd, not the input LDIF file for slapadd.

Concept tested: OpenLDAP slapadd input method

Source: http://www.openldap.org/doc/admin/slapadd.html

Topics

#LDAP Administration#LDIF Files#slapadd Command#Command Line Utilities

Community Discussion

No community discussion yet for this question.

Full LFCS Practice