Linux Essentials (010-160) — Question 18
Which of the following commands creates an archive file work.tar from the contents of the directory ./work/?
Answer options
- A. tar --new work.tar ./work/
- B. tar -cf work.tar ./work/
- C. tar -create work.tgz -content ./work/
- D. tar work.tar < ./work/
- E. tar work > work.tar
Correct answer: B
Explanation
The correct answer is B because the '-c' option tells tar to create an archive and the '-f' option specifies the filename. Options A and C are incorrect due to the use of incorrect flags, while D and E do not correctly create an archive file.