![]() ![]() However, for any questions or feedback, reach us using the comment section below. Lastly, with the simple elaborations above, I believe you are now capable of compressing and decompressing. To view the bzip2 help page and man page, type the command below: $ bzip2 -h $ bzip2 -vfd Etcher-linux-圆4.AppImage.bz2 bz2 extension for the command above to work. bz2 file, make use of the -d or -decompress option like so: $ bzip2 -d filename.bz2 Compress Files Using bzip2 in Linux How to Use “bzip2” to Decompress Files in Linux The screenshot below shows how to use options to keep the input file, force bzip2 to overwrite an output file and set the block size during compression. You can as well set the block size to 100k upto 900k, using -1 or -fast to -9 or –best as shown in the below examples: $ bzip2 -k1 Etcher-linux-圆4.AppImage In addition, the -f or -force flag will force bzip2 to overwrite an existing output file. Important: By default, bzip2 deletes the input files during compression or decompression, to keep the input files, use the -k or -keep option. tar file, use the command format: $ bzip2 -z backup.tar ![]() You can compress a file as below, where the flag -z enables file compression: $ bzip2 filename How to Use “bzip2” to Compress Files in Linux The conventional syntax of using bzip2 is: $ bzip2 option(s) filenames bz2 files using the bzip2 tool in Linux.īzip2 is a well known compression tool and it’s available on most if not all the major Linux distributions, you can use the appropriate command for your distribution to install it. In this tutorial, we will look at how to compress and decompress. There are several file compression and decompression tools available in Linux such as gzip, 7-zip, Lrzip, PeaZip and many more. Suggested Read: Learn Linux ‘tar’ Command with This 18 Examples On the other hand, decompressing a file(s) means restoring data in the file(s) to its original state. BSD tar does its compression using libarchive (they're not really distinct except in name).To compress a file(s), is to significantly decrease the size of the file(s) by encoding data in the file(s) using less bits, and it is normally a useful practice during backup and transfer of a file(s) over a network. The tar program can use external compression programs gzip, bzip2, xz by opening a pipe to those programs, sending a tar archive via the pipe to the compression utility, which compresses the data which it reads from tar and writes the result to the filename which the tar program specifies.Īlternatively, the tar and compression utility could be the same program. The GNU tar program does not know how to compress an existing file such as user-logs.tar ( bzip2 does that). While Fedora might be (perhaps dnf): sudo yum install bzip2 For example, with Ubuntu that would be sudo apt-get install bzip2 Which (if you had bzip2 installed) would change the file to 2 (and usually make it much smaller).įor installing bzip2, it depends on the system you are using. If you have a tar archive and simply want to compress it, you could do this: bzip2 user-logs.tar The tar program relies upon this external program to do compression. In the second case, the problem is that you do not have bzip2 installed. The error message tells what to do: you probably need to add -c (for create), e.g., tar -jcf user-logs.tar myargsĪs well as some arguments myargs (things to put into the user-logs.tar archive). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |