Bird
0
0

You want to create a zip archive project.zip that excludes all .log files inside the project folder recursively. Which command achieves this?

hard📝 Application Q8 of 15
Linux CLI - Archiving and Compression
You want to create a zip archive project.zip that excludes all .log files inside the project folder recursively. Which command achieves this?
Azip project.zip -r project --exclude '*.log'
Bzip -r project.zip project -x '*.log'
Czip -r project.zip project --ignore '*.log'
Dzip -r project.zip project -e '*.log'
Step-by-Step Solution
Solution:
  1. Step 1: Identify exclusion syntax for zip

    The -x option excludes files matching a pattern during zip creation.
  2. Step 2: Check command correctness

    zip -r project.zip project -x '*.log' uses -r for recursion and -x '*.log' to exclude log files correctly. Others use invalid or unsupported options.
  3. Final Answer:

    zip -r project.zip project -x '*.log' -> Option B
  4. Quick Check:

    Exclude files in zip = use -x pattern [OK]
Quick Trick: Use -x 'pattern' to exclude files in zip [OK]
Common Mistakes:
  • Using --exclude or --ignore (not supported)
  • Placing -x before -r incorrectly
  • Using -e which is for encryption

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes