Challenge - 5 Problems
Find with Exec Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of find with -exec to list files
What is the output of this command if the current directory contains files
file1.txt and file2.log only?find . -name '*.txt' -exec ls -l {} \;Linux CLI
find . -name '*.txt' -exec ls -l {} \;Attempts:
2 left
💡 Hint
The command finds files ending with .txt and runs ls -l on each.
✗ Incorrect
The find command searches for files matching '*.txt' and runs 'ls -l' on each found file. Only file1.txt matches, so only its details are listed.
💻 Command Output
intermediate2:00remaining
Effect of find with -exec rm on files
Given a directory with files
a.txt, b.txt, and c.log, what files remain after running?find . -name '*.txt' -exec rm {} \;Linux CLI
find . -name '*.txt' -exec rm {} \;Attempts:
2 left
💡 Hint
The command deletes files ending with .txt.
✗ Incorrect
The find command locates all files ending with .txt and deletes them with rm. Only c.log remains.
📝 Syntax
advanced2:00remaining
Correct syntax for find with -exec to move files
Which option correctly moves all
.log files to /backup using find with -exec?Attempts:
2 left
💡 Hint
The -exec command must end with an escaped semicolon.
✗ Incorrect
The correct syntax requires the escaped semicolon '\;' to mark the end of the command for -exec. Options B, C, and D miss this or have wrong escaping.
🔧 Debug
advanced2:00remaining
Why does this find with -exec command fail?
This command is intended to compress all
Why does it fail?
.txt files with gzip:find . -name '*.txt' -exec gzip {} ;Why does it fail?
Linux CLI
find . -name '*.txt' -exec gzip {} ;Attempts:
2 left
💡 Hint
Check how the semicolon is written at the end of -exec.
✗ Incorrect
The semicolon must be escaped as '\;' to prevent shell interpreting it. Without escape, find sees syntax error.
🚀 Application
expert3:00remaining
Count files modified in last 7 days and delete them
Which command correctly finds files modified in the last 7 days and deletes them safely using find with -exec?
Attempts:
2 left
💡 Hint
Use -mtime with negative value for files modified within last N days and confirm deletion.
✗ Incorrect
Option B finds files modified less than 7 days ago and deletes them interactively (-i). Others either use wrong time, no confirmation, or missing escape.