010-160 Exam QuestionsBrowse all questions from this exam

010-160 Exam - Question 18


Which of the following commands creates an archive file work.tar from the contents of the directory ./work/?

Show Answer
Correct Answer: B

To create an archive file using the `tar` command in Linux, the correct syntax involves using the `-c` option to create the archive and the `-f` option to specify the name of the archive file. Therefore, `tar -cf work.tar ./work/` will correctly create an archive named work.tar from the contents of the ./work/ directory.

Discussion

7 comments
Sign in to comment
JichzOption: B
Aug 10, 2020

B is the right answer but it's wrongly typed tar -cf work.tar ./work/

beazzlebub
Jul 25, 2021

for some reason the platform is replacing dashes with four single quotes

TheITStudent
Jul 2, 2022

http://www.linfo.org/tar.html

linvidiaOption: B
Oct 26, 2022

tar -cf work.tar ./work/ # Create work.tar from files in ./work/ .

POGActualOption: B
Dec 11, 2022

the answer is B. tar -cf work.tar ./work/. The -cf option combines -c option which is to create the tar file, and -f which is the option to name the file. "To create an archive with tar, use the ‘-c’ (“create”) option, and specify the name of the archive file to create with the ‘-f’ option. It’s common practice to use a name with a ‘.tar’ extension, such as ‘my-backup.tar’." https://training.linuxfoundation.org/blog/how-to-create-and-manage-archive-files-in-linux/

VovanichOption: B
Dec 20, 2022

B. tar ג€"cf work.tar ./work/

LMo84Option: B
Mar 19, 2023

B is the Answer.

rcarugati
Aug 10, 2023

ג€" What does it mean, someone could explain to me?

WOAH_ANNIE
Aug 31, 2023

it is a typo from -cf