During a post-incident investigation you must safeguard every configuration file (*.conf) located anywhere under /etc that was modified within the last 48 hours. The files must be copied to /tmp/conf_backup and the original directory hierarchy has to be preserved so each file can later be restored to its exact path. Which single command meets these requirements?
The command has to (1) locate only .conf files below /etc, (2) restrict the results to files modified in the last two 24-hour periods (-mtime -2), (3) copy the matches to /tmp/conf_backup, and (4) reproduce the full path of every source file inside the target directory. The find expression "-type f -name ".conf" -mtime -2" satisfies the first two conditions. The GNU cp option "--parents" causes cp to re-create the entire path of each SOURCE beneath the destination directory, fulfilling the hierarchy requirement; using plain cp or cp --recursive would flatten the structure. Therefore only the command that combines find with -exec cp --parents /tmp/conf_backup ; accomplishes all of the stated goals. Using +2 would select files older than 48 hours, and omitting --parents would lose the directory layout.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the '-mtime -2' option in the find command do?
Open an interactive chat with Bash
What is the purpose of the '--parents' option in the cp command?
Open an interactive chat with Bash
Why is the '-exec' option in the find command used instead of just piping to cp?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .