Bird
0
0

You want to find files named config.json but your command find . -name config.json returns no results, even though the file exists. What is the problem?

medium📝 Debug Q7 of 15
Linux CLI - Searching and Finding
You want to find files named config.json but your command find . -name config.json returns no results, even though the file exists. What is the problem?
AThe filename should be quoted as 'config.json'
BYou need to use -filename instead of -name
CThe file is hidden and find ignores hidden files
DThe file is in a different directory
Step-by-Step Solution
Solution:
  1. Step 1: Understand how shell treats unquoted patterns

    Without quotes, shell may try to expand config.json before find runs.
  2. Step 2: Use quotes to pass exact filename

    Quoting 'config.json' ensures find receives the correct pattern.
  3. Final Answer:

    The filename should be quoted as 'config.json' -> Option A
  4. Quick Check:

    Quoting filenames avoids no result issues = A [OK]
Quick Trick: Quote filenames in find to match exactly [OK]
Common Mistakes:
  • Using -filename option
  • Assuming hidden files are ignored
  • Not checking file location

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes