Challenge - 5 Problems
Find Command Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Find files by name
What is the output of this command if the current directory contains files:
report.txt, data.csv, and notes.txt?Linux CLI
find . -name '*.txt'Attempts:
2 left
💡 Hint
The
-name option filters files by pattern, including the path.✗ Incorrect
The
find command searches recursively from the current directory (.) and lists files matching '*.txt'. It shows relative paths starting with './'.💻 Command Output
intermediate1:30remaining
Find files by size
What files will this command list if the directory has files:
a.log (500 bytes), b.log (1500 bytes), and c.log (2500 bytes)?Linux CLI
find . -size +1000cAttempts:
2 left
💡 Hint
The
-size +1000c finds files larger than 1000 bytes.✗ Incorrect
Files larger than 1000 bytes are
b.log and c.log. The command lists them with relative paths.📝 Syntax
advanced2:00remaining
Correct find syntax for multiple conditions
Which option correctly finds files with extension
.txt or .md in the current directory?Attempts:
2 left
💡 Hint
Use the correct logical OR operator for find.
✗ Incorrect
The
-o option means OR in find. -or is not valid syntax. -and means AND, and || is shell syntax, not find syntax.🔧 Debug
advanced2:00remaining
Why does this find command fail?
This command is intended to find all files modified in the last 7 days but returns no results. Why?
find . -mtime 7Attempts:
2 left
💡 Hint
Check what the number after
-mtime means.✗ Incorrect
The
-mtime 7 finds files modified exactly 7*24 hours ago, not within the last 7 days. To find files modified within 7 days, use -mtime -7.🚀 Application
expert2:30remaining
Find and delete empty files safely
Which command safely finds and deletes all empty files in the current directory and its subdirectories?
Attempts:
2 left
💡 Hint
Use the safest and simplest way to delete empty files with find.
✗ Incorrect
Option A uses
-empty to find empty files and -delete to remove them safely. Option A tries to delete empty directories too. Option A deletes files by size but is less clear. Option A deletes files by size but -delete is safer combined with -empty.