nerdexam
Linux_Foundation

LFCS · Question #143

Which of the following arguments complete the command which will search for cn=ldapadmin OR ou=BR recursively in the directory? ldapsearch -LLL -h server -s sub -b "o=inc" "_______"

The correct answer is B. ( |(cn=ldapamin) (ou=BR) ). To perform an OR search in LDAP, the filter syntax requires the | operator to precede the conditions within parentheses.

Submitted by noor.lb· Apr 18, 2026Essential Commands

Question

Which of the following arguments complete the command which will search for cn=ldapadmin OR ou=BR recursively in the directory? ldapsearch -LLL -h server -s sub -b "o=inc" "_______"

Options

  • A( (cn=ldapamin)|(ou=BR) )
  • B( |(cn=ldapamin) (ou=BR) )
  • C( (cn=ldapamin) (ou=BR) )
  • D( (cn=ldapamin) (ou=BR)| )
  • E( (cn=ldapamin)||(ou=BR) )

How the community answered

(68 responses)
  • A
    4% (3)
  • B
    91% (62)
  • D
    1% (1)
  • E
    3% (2)

Why each option

To perform an OR search in LDAP, the filter syntax requires the `|` operator to precede the conditions within parentheses.

A( (cn=ldapamin)|(ou=BR) )

This syntax `( (cn=ldapamin)|(ou=BR) )` incorrectly places the `|` operator between the conditions, which is not valid LDAP filter syntax for an OR.

B( |(cn=ldapamin) (ou=BR) )Correct

The correct LDAP filter syntax for an OR operation places the `|` operator at the beginning of the parenthesized list of conditions, meaning `( |(condition1)(condition2) )` represents 'condition1 OR condition2'.

C( (cn=ldapamin) (ou=BR) )

This syntax `( (cn=ldapamin) (ou=BR) )` represents an AND operation because the operator is implicitly AND when multiple conditions are listed without an explicit operator.

D( (cn=ldapamin) (ou=BR)| )

This syntax `( (cn=ldapamin) (ou=BR)| )` incorrectly places the `|` operator at the end of the conditions, which is not valid LDAP filter syntax for an OR.

E( (cn=ldapamin)||(ou=BR) )

This syntax `( (cn=ldapamin)||(ou=BR) )` uses `||`, which is not a valid LDAP filter operator for OR; the correct operator is a single `|`.

Concept tested: LDAP search filter OR syntax

Source: https://ldap.com/ldap-filters/

Topics

#ldapsearch#LDAP filters#Command syntax#Directory services

Community Discussion

No community discussion yet for this question.

Full LFCS Practice