11.4k views
2 votes
What is the command to create a compressed archive(archive1.tar.gz) of files test1 test2and test3.

User Kevin Yang
by
7.8k points

1 Answer

4 votes

Answer:

The command to create a compressed archive (archive1.tar.gz) is


tar\,\,-czvf\,\,archive1.tar.gz\,\,test1\,\,test2\,\,test3

Step-by-step explanation:

The explanation for the above command is

The general command to create a compressed archive is

tar -czvf name-of-archive.tar.gz /path/to/directory-or-files

Here, the terms are as follows:

-c : Creates an archive

-z : Compress the archive with gzip.

-v : This is known as verbose. This is an optional command and it displays the progress on terminal command. Without this the progress is not displayed on terminal command.

-f : Allows to specify the file name of the archive.

Here, if we want to archive multiple files, we provide the command the names of multiple files or directories of the files also can be used.

So, the command
tar\,\,-czvf\,\,archive1.tar.gz\,\,test1\,\,test2\,\,test3

creates a compressed archive - archive1.tar.gz of files test1, test2 and test3.

User Htbaa
by
7.8k points