how to pack and unpack files on the server – ZIP TAR TAR.GZ

The following guide describes how to package and unpack files and directories on a Linux server

ZIP - packaging files and directories

After the command and the "zip -r" parameter we specify the archive name, followed by a space after the names of directories and files that will be packed, for example,:

ZIP - unpacking files and directories

After the unzip command, we give the name of the archive in which the packed files are located, for example,:

TAR - packaging files and directories

After the command with the "tar -cvf" parameters, we specify the archive name, followed by a space after the names of directories and files that will be packed, for example,:

TAR - unpacking files and directories

After the command with the "tar -xvf" parameters, we specify the archive name. If we want to specify the place to which the files are to be extracted, we give the "-C" parameter and the target path after the archive name, for example,:

TAR.GZ - packing files and directories with compression

To package files with compression you just need, that the tar command from the examples above will add the "z" parameter. Our command will then look like this:

TAR.GZ - unpacking compressing files and directories

The command has the following form:

If we want to add a path to the command to which the files are to be unpacked, just add the -C parameter and the target path, for example,:

How useful this post was?

Click on the star, to evaluate it!

Average grade / 5. number of votes:

So far, no votes! Be the first to rate this post.