nerdexam
Linux_Foundation

LFCS · Question #169

Which command will perform a one-level search from the DN c=INC, for all entries whose organization's name begins with RioDeJaneiro?

The correct answer is C. ldapsearch -LLL -s one -b "c=INC" "(o=RioDeJaneiro*)". The correct ldapsearch command performs a one-level search from the specified base DN, filtering for entries where the organizational name begins with 'RioDeJaneiro'.

Submitted by chen.hong· Apr 18, 2026Operation of Running Systems

Question

Which command will perform a one-level search from the DN c=INC, for all entries whose organization's name begins with RioDeJaneiro?

Options

  • Aldapsearch -LLL -b "c=INC" "(o=description)" RioDeJaneiro*
  • Bldapsearch -b "c=INC" -f "(o=description,cn=RioDeJaneiro%)"
  • Cldapsearch -LLL -s one -b "c=INC" "(o=RioDeJaneiro*)"
  • Dldapsearch -s sub -b "c=INC" -f "(o=RioDeJaneiro)(description)"

How the community answered

(50 responses)
  • A
    2% (1)
  • B
    10% (5)
  • C
    82% (41)
  • D
    6% (3)

Why each option

The correct `ldapsearch` command performs a one-level search from the specified base DN, filtering for entries where the organizational name begins with 'RioDeJaneiro'.

Aldapsearch -LLL -b "c=INC" "(o=description)" RioDeJaneiro*

The filter `"(o=description)" RioDeJaneiro*` is syntactically incorrect; the search string 'RioDeJaneiro*' is outside the filter parentheses and 'o=description' is not the intended filter.

Bldapsearch -b "c=INC" -f "(o=description,cn=RioDeJaneiro%)"

The `-f` option is used to specify a file containing the filter, not the filter itself directly on the command line, and the filter syntax `"(o=description,cn=RioDeJaneiro%)"` uses an incorrect wildcard `%` and an invalid comma within an attribute value assertion.

Cldapsearch -LLL -s one -b "c=INC" "(o=RioDeJaneiro*)"Correct

The `-LLL` option outputs search results in a clean LDIF format without extraneous comments. `-s one` correctly sets the search scope to one level below the base DN, as requested. `-b "c=INC"` specifies the base distinguished name for the search, and `"(o=RioDeJaneiro*)"` is the accurate filter to match entries where the 'o' (organization name) attribute starts with 'RioDeJaneiro', using the standard LDAP wildcard character `*`.

Dldapsearch -s sub -b "c=INC" -f "(o=RioDeJaneiro)(description)"

The `-s sub` option specifies a subtree search, which is deeper than the requested one-level search, and the filter `"(o=RioDeJaneiro)(description)"` implies an `AND` operation between two separate attributes, not a pattern match on a single attribute.

Concept tested: LDAP search command syntax

Topics

#ldapsearch#LDAP#Directory Services#Command Line Interface

Community Discussion

No community discussion yet for this question.

Full LFCS Practice