While tar is frequently used to compress a single directory, you could also use it to compress multiple directories, multiple individual files , or both. Just provide a list of files or directories instead of a single one. In some cases, you may wish to compress an entire directory, but not include certain files and directories.
You can do so by appending an --exclude switch for each directory or file you want to exclude. The --exclude switch is very powerful.
For example, you could archive an entire directory and exclude all. While gzip compression is most frequently used to create. This allows you to create bzip2-compressed files, often named. To do so, just replace the -z for gzip in the commands here with a -j for bzip2. Gzip is faster, but it generally compresses a bit less, so you get a somewhat larger file.
Bzip2 is slower, but it compresses a bit more, so you get a somewhat smaller file. Gzip is also more common, with some stripped-down Linux systems including gzip support by default, but not bzip2 support. In general, though, gzip and bzip2 are practically the same thing and both will work similarly. Once you have an archive, you can extract it with the tar command.
The following command will extract the contents of archive. This specifies you want to e x tract an archive instead of create one. You may want to extract the contents of the archive to a specific directory. You can do so by appending the -C switch to the end of the command. For example, the following command will extract the contents of the archive.
This is the simplest possible usage of the tar command. We hate spam as much as you! Unsubscribe any time Powered by follow. Tweet Share Submit. Also, because you are using tar on Windows 10, you do not need to specify the path as if you were running Linux.
You can use the path format used by Windows. Quick tip: In the command, make sure to update the syntax to include the source and destination paths. The addition of the —z option is what signals tar to compress the files. This copies the contents of your Documents folder into a single file, called documents. The options -cvf work as follows:. This command extracts and lists all files from the documents. The -x option tells tar to extract the files.
You can also use xargs with tar to create a tar. Note: Some graphical interfaces include a tool for managing tar. Simply right-click the item you want to compress, mouseover compress, and choose tar. You can also right-click a tar. This tutorial explains how to use the tar tool, the gzip tool, and how to utilize them together to work with tar.
Read more about how to extract entire archive s and how to extract selected files from archive. To extract a spanned split TAR file, save all the parts in the same directory, then open as usual the first volume of the archive, which has. Read more about how to manage spanned split archive files. Tarbomb term designates a malicious. Tarbomb can be easily avoided decompressing the tar file using "extract to new folder" option. This operation can be performed with PeaZip utility in a single pass using "TAR before" option and chosing a final archive format supporting encryption.
Releases Feed. PeaZip Wiki. Developer email.
0コメント