Challenge - 5 Problems
Find Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Find files named 'report.txt' of type regular file
What is the output of this command if the current directory contains exactly one regular file named 'report.txt' and no other files with that name?
find . -name 'report.txt' -type fLinux CLI
find . -name 'report.txt' -type f
Attempts:
2 left
💡 Hint
The command finds regular files named exactly 'report.txt' in the current directory and subdirectories.
✗ Incorrect
The find command prints the relative path starting with './' for files found. Since there is one regular file named 'report.txt' in the current directory, it outputs './report.txt'.
💻 Command Output
intermediate1:30remaining
Find directories named 'backup' larger than 1MB
What will this command output if there is one directory named 'backup' with size 2MB and one file named 'backup' with size 3MB?
find . -name 'backup' -type d -size +1MLinux CLI
find . -name 'backup' -type d -size +1M
Attempts:
2 left
💡 Hint
The command looks for directories named 'backup' larger than 1MB, not files.
✗ Incorrect
The command finds directories (-type d) named 'backup' with size greater than 1MB. Only the directory matches, so it outputs './backup'.
📝 Syntax
advanced2:00remaining
Correct find command to locate regular files named '*.log' smaller than 500KB
Which option is the correct find command to locate regular files with names ending in '.log' and size less than 500KB?
Attempts:
2 left
💡 Hint
Order of options does not matter, but size sign and type must be correct.
✗ Incorrect
Option C correctly finds regular files (-type f) named '*.log' with size less than 500KB (-size -500k). Option C uses lowercase 'k' which is valid but order is less conventional. Option C uses +500k which means larger than 500KB. Option C searches directories (-type d) which is incorrect.
🔧 Debug
advanced2:00remaining
Why does this find command fail to find files larger than 1MB?
Given this command:
It returns no results even though there are CSV files larger than 1MB. What is the most likely reason?
find /data -type f -name '*.csv' -size +1MIt returns no results even though there are CSV files larger than 1MB. What is the most likely reason?
Linux CLI
find /data -type f -name '*.csv' -size +1M
Attempts:
2 left
💡 Hint
Check how the find command interprets size units by default.
✗ Incorrect
By default, find's '-size' option counts in 512-byte blocks unless a unit is specified. 'M' means mebibytes (1,048,576 bytes). If the system does not support 'M' or the version is old, it may interpret '+1M' as '+1 * 512 bytes' which is very small. This causes unexpected results.
🚀 Application
expert2:30remaining
Find all empty directories named 'temp' and delete them safely
Which command will find all empty directories named 'temp' under /var/log and delete them safely, prompting before each deletion?
Attempts:
2 left
💡 Hint
You want to delete directories safely with confirmation and only empty ones named 'temp'.
✗ Incorrect
Option B uses '-empty' to find empty directories named 'temp' and '-exec rm -ri {} +' to remove them interactively, prompting before each deletion. Option B deletes without prompt. Option B deletes recursively without prompt. Option B deletes interactively but not recursively, which fails for directories.