nerdexam
CompTIA

LX0-104 · 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*)". This question tests knowledge of the ldapsearch command's options for specifying search base, scope, and filters for LDAP directory queries.

Shells, Scripting and Data Management

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

(32 responses)
  • A
    3% (1)
  • B
    13% (4)
  • C
    78% (25)
  • D
    6% (2)

Why each option

This question tests knowledge of the `ldapsearch` command's options for specifying search base, scope, and filters for LDAP directory queries.

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

The filter `"(o=description)" RioDeJaneiro*` is malformed; `RioDeJaneiro*` is not part of the filter string and `o=description` is not the intended search criteria.

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

The `-f` option is for reading a filter from a file, not for specifying the filter directly on the command line; also, the filter `"(o=description,cn=RioDeJaneiro%)"` uses incorrect syntax and an invalid wildcard `%`.

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

The `-s one` option specifies a one-level search scope, meaning it searches entries directly below the base DN but not their children. The `-b "c=INC"` sets the base DN for the search, and `"(o=RioDeJaneiro*)"` defines the filter to find entries where the organization attribute (`o`) begins with "RioDeJaneiro".

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

The `-s sub` option performs a subtree search, which is not a one-level search, and the `-f` option is used incorrectly as in choice B.

Concept tested: ldapsearch command syntax and options (scope, base, filter)

Source: https://manpages.debian.org/testing/ldap-utils/ldapsearch.1.en.html

Topics

#ldapsearch#LDAP search syntax#LDAP filters#Command-line utilities

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice