Bird
0
0

What will be the output of the following command if the directory project contains files and subdirectories?

medium📝 Command Output Q13 of 15
Linux CLI - Archiving and Compression
What will be the output of the following command if the directory project contains files and subdirectories?

tar -cJf project.tar.xz project
ACreates an uncompressed tar archive named project.tar.xz
BCreates an xz compressed tar archive named project.tar.xz
CCreates a gzip compressed tar archive named project.tar.xz
DThrows an error because -J is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Understand the -J flag

    The -J flag tells tar to use xz compression.
  2. Step 2: Analyze the command output

    The command creates a compressed archive named project.tar.xz using xz compression from the project directory.
  3. Final Answer:

    Creates an xz compressed tar archive named project.tar.xz -> Option B
  4. Quick Check:

    -J means xz compression [OK]
Quick Trick: Remember: -J compresses with xz, matching .tar.xz files [OK]
Common Mistakes:
  • Thinking -J is invalid
  • Confusing -J with -z or -j
  • Assuming no compression happens

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes