Bird
0
0

Which of the following is the correct syntax for using the tar command to create an archive named backup.tar from the directory data?

easy📝 Syntax Q3 of 15
Linux CLI - Linux Basics and Terminal
Which of the following is the correct syntax for using the tar command to create an archive named backup.tar from the directory data?
Atar data -cvf backup.tar
Btar backup.tar -cvf data
Ctar -f backup.tar -cv data
Dtar -cvf backup.tar data
Step-by-Step Solution
Solution:
  1. Step 1: Understand tar options order

    The tar command uses options like -c (create), -v (verbose), and -f (file) before the archive name.
  2. Step 2: Match correct syntax

    The correct order is tar -cvf archive_name directory, so tar -cvf backup.tar data is correct.
  3. Final Answer:

    tar -cvf backup.tar data -> Option D
  4. Quick Check:

    Options before archive and arguments [OK]
Quick Trick: Options come before archive name and target in tar commands [OK]
Common Mistakes:
  • Mixing order of options and arguments
  • Placing archive name before options
  • Using wrong option letters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes