nerdexam
CompTIACompTIA

XK0-005 · Question #417

XK0-005 Question #417: Real Exam Question with Answer & Explanation

The correct answer is D: find . -type f -print | xrags grep -li denied. {"question_number": 7, "explanation": "To find files containing the word 'denied' in either uppercase or lowercase, the correct grep flags are -l (list only filenames with matches, not the matching lines) and -i (case-insensitive matching). The pipeline find . -type f -print | xa

Troubleshooting

Question

A Linux administrator reviews a set of log output files and needs to identify files that contain any occurrence of the word denied. All log files containing entries in uppercase or lowercase letters should be included in the list. Which of the following commands should the administrator use to accomplish this task?

Options

  • Afind . -type f -print | xrags grep -ln denied
  • Bfind . -type f -print | xrags grep -nv denied
  • Cfind . -type f -print | xrags grep -wL denied
  • Dfind . -type f -print | xrags grep -li denied

Explanation

{"question_number": 7, "explanation": "To find files containing the word 'denied' in either uppercase or lowercase, the correct grep flags are -l (list only filenames with matches, not the matching lines) and -i (case-insensitive matching). The pipeline find . -type f -print | xargs grep -li denied locates all regular files and passes them to grep, which outputs only the filenames of files that contain 'denied' in any case. Option A uses -n which outputs line numbers, not just filenames. Option B uses -v which inverts the match (finds lines NOT containing 'denied'). Option C uses -L which lists files that do NOT contain the pattern - the opposite of what is needed.", "generated_by": "claude-sonnet", "llm_judge_score": 4}

Topics

#grep#find#xargs#Log Analysis

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions