Bird
0
0

How can you use find with -exec to change permissions to 644 for all .conf files in /etc and its subdirectories?

hard📝 Application Q9 of 15
Linux CLI - Searching and Finding
How can you use find with -exec to change permissions to 644 for all .conf files in /etc and its subdirectories?
Afind /etc -type f -name '*.conf' -exec chmod 644 {} \;
Bfind /etc -type f -name '*.conf' -exec chmod 644 {}
Cfind /etc -type f -name '*.conf' -exec chmod 644 \;
Dfind /etc -type f -name '*.conf' -exec chmod {} 644 \;
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct chmod syntax

    The command chmod 644 {} changes permissions of each file.
  2. Step 2: Confirm proper -exec termination

    The command ends with \; to terminate -exec correctly.
  3. Final Answer:

    find /etc -type f -name '*.conf' -exec chmod 644 {} \; -> Option A
  4. Quick Check:

    Correct chmod and -exec syntax = C [OK]
Quick Trick: Use chmod with {} and end -exec with \; [OK]
Common Mistakes:
  • Omitting {} placeholder
  • Missing \; at the end
  • Swapping chmod arguments

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes