Which of the following commands is used to create a tar file?
A.
tar -ivf filename.tar directory/file
B.
tar -cvf filename.tar directory/file
C.
tar -tvf filename.tar
D.
tar -xvf filename.tar
Explanation:
The tar -cvf filename.tar directory/file command is used to create a tar file. filename.tar represents
the file you are creating and directory/file represents the directory and file you want to put in the
archived file.Answer option C is incorrect. The tar -tvf filename.tar command is used to list the contents of a tar
file.
Answer option D is incorrect. The tar -xvf filename.tar command is used to extract the contents of
a tar file.
Answer option A is incorrect. There is no such command as tar -ivf filename.tar directory/file.