Multiple choice technology programming languages

How do I tar/untar a file?

  1. tar -cvf file/tar -xvf file

  2. tar -xvf file /tar -cvf file

  3. tar -cvf file.tar <file>/tar -xvf file.tar <file>/

  4. tar -xvf file.tar <file>/tar -cvf file.tar <file>/

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

tar -cvf creates archives (c=create, v=verbose, f=file) and tar -xvf extracts them (x=extract). The correct syntax requires specifying the archive filename: tar -cvf archive.tar file(s) to create, tar -xvf archive.tar to extract. Option A and B reverse the create/extract order.