Multiple choice technology operating systems

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 an archive (create, verbose, file), while tar -xvf extracts (extract, verbose, file). The syntax requires naming the .tar archive file explicitly before listing files to add. Options A and B show incorrect syntax - they reference 'file' inconsistently and omit the .tar extension or use forward slashes incorrectly.