Bzip2 is not recognized as an internal or external command, operable program or batch file
IntroductionSource code is often packed for download as a TAR (Tape ARchive) file, that is a standard format in the Unix/Linux world. These files have a .tar extension; they can also be compressed, the extension is .tar.gz or .tar.bz2 in these cases. There are several ways to unpack these files. Show
tarIf you have MinGW/MSYS or Cygwin installed, you can use the tar command to unpack such files: tar xvf <.tar file> tar xzvf <.tar.gz file> tar xjvf <.tar.bz2 file> Try 7-ZipAnother option is to install 7-Zip, which has a nice graphical user interface. 7-Zip can also be used to unpack many other formats and to create tar files (amongst others).
Instead of using 7-Zip on the command line, you can use the file manager and click on a .tar, .tar.gz, or.tar.bz2 file; 7-Zip will automatically start. TarToolA simple windows command line tool (no install , just unzip) Its hosted on codeplex tartool, complete with the source code.
>TarTool.exe Usage : >TarTool sourceFile destinationDirectory >TarTool D:\sample.tar.gz ./ >TarTool sample.tgz temp >TarTool -x sample.tar temp TarTool 2.0 Beta supports bzip2 files such as tar.bz2 and .bz2 extraction. TarTool -xj sample.tar.bz2 temp or TarTool -j sample.bz2 More details are on this post -- http://blog.rajasekharan.com/2009/01/16/tartool-windows-tar-gzip-tgz-extraction-tool/ File Archiving, File Management, Compression, Decompression, Extraction, Tar, Zip, See also: File Archiving and Compression, Accessing and Sharing Files, Network Access, Windows Terminal Servers 7-Zip Versions7-Zip is an Archive and File Management utility available in command-line versions for Linux/Mac, "P7Zip" (7z.exe), as well as for Windows, "7za" (7za.exe). Although its interface is deceptively simple, the command-line versions of 7ZIP are highly customizable archiving programs when used with the command parameters and switchesdescribed below. Windows users who want to use the command-line version should generate a Help Desk ticket to install the standalone 7za.exe version. To begin a session, open a terminal window. Invoke the version of 7Zip you are using by entering "7z" for P7Zip (7z.exe), or "7za" for 7Zip for Windows (7za.exe) to start either the P7-Zip or 7za application prior to entering commands. Other than this program invocation command, all commands, parameters and switches are identical for all command-line versions. NOTE TO WINDOWS USERS: the following syntax examples begin by invoking the Linux command-line version, "7z". Please change the invocation to "7za" when applying these examples for use in 7-Zip for Windows. Command Line SyntaxThe general command line syntax begins by invoking the version of 7Zip you are using: "7z" for P7Zip (7z.exe) users or "7za" for 7Zip for Windows (7za.exe) users followed by the command and parameters: "command" "switches" "full_path_archive_name" "full_path_file_name" Eg; 7z a -p 7Zip_Archive Test_file.txt creates a 7z formatted archive named 7Zip_Archive that is protected with a password, then adds a file named test_file.txt to the archive. Parameter and Switch Syntax:
Use a separate -m switch for each parameter when adding them to the command line. For example: 7z a -t7z Encrypt.7z Test8.txt -mx=7 -mhe=on uses the File Names: The command-line versions of 7Zip look to the directory where the 7Zip executable file is located to find the files you are managing. Therefore, you will need to begin a session either by moving your files into 7Zip's directory or by using the full path for the file names. Eg; 7z a "c:\Documents and Settings\JDoe\Desktop\archive_name.zip" "c:\Documents and Settings\JDoe\Desktop\file_name.txt" creates a ZIPformatted archive and adds the specified text file to it. The full path must be enclosed in quotes as in the example above if any portion of it contains a space. Additionally, Windows users should use the Set Sensitive Case mode switch to "insensitive" (-ssc-). Syntax Conventions(archive format) - must be one of the supported archive formats. 7ZIP's native format, 7z, is the default. See Creating an Archive for detailed information on archive types. The archive type is denoted by the file type extension (eg., ".7z", ".zip", ".tar") you specify. If the archive doesn't exist, 7Zip will create it when you add the initial file(s). [expressions] - optional, but only one expression can be specified - eg; hc=[off | on] is specified as "hc=on" to enable header compression in the command line; use one switch per expression in most cases, the
-m switch. {expression} - if used, replace with a user-defined string - eg; {password} is replaced by "myGreat!paSSphr4se" in the command line; must be combined with a switch or command. The "base_archive_name" must be the first filename on the command line after the archive format and command. Switches and other filenames can be in any order. Wildcards or filenames with spaces must be quoted:
Switch options can be combined to save command line length. However, some switch options take optional string arguments, and therefore must be the last option in a combined argument token string because 7-Zip accepts the rest of the argument token as the optional argument. Time Dependent ConsiderationsTransferring files to recipients in other time zones, Daylight Savings Time adjustments and relocating notebook computers to different time zones can cause problems with update commands that depend on the file's modification time. Therefore, employ only a file system and archive format that uses Coordinated Universal Time (UTC) if possible. For example, select the NTFS file system and choose one of the archive formats that support UTC like 7z or ZIPcombined with the -mtc switch. However, in cases where you are restricted to using a file system that uses local time, use an archive format that supports local time as well; for example, use ZIP with FAT32.
Command Detailed Reference
Switch Detailed Reference
Wildcard Parsers
"*.txt" means all files with an extension of ".txt" "?a*" means all files with a second character of "a" "*1*" means all names that contain the character "1" "*.*.*" means all names that contain at least two "." characters The default wildcard, "*", will be used if there is no filename or wildcard in the command line. Wildcards containing spaces must be placed in quotes. For example:
List FilesYou can supply one or more filenames or wildcards for special list files (files containing lists of files). Each filename in such a list file must be separated by a new line symbol. For list files, 7-Zip uses UTF-8 encoding by default and supports multiple lists files. Use -scs switch to change the encoding. For example, if the file "listfile.txt" contains the following:
then the command 7z a -tzip archive.zip @listfile.txt adds to the archive named "archive.zip" all "*.cpp" files from the directories named "My programs" and "Src". Archive Formats and Parameters:Methods, Filters and Their Paramters: {N}={MethodID}[:param1][:param2] ... [:paramN] (higher values correspond to higher compression ratios but slower speeds) For example, mf=HC4 and mc=10000 can provide almost the same compression ratio as mf=BT4 7z Archive Format Parameters
Syntax:Use the -t7z switch after the "a" command or specify "archive_name.7z" to create a 7z archive. Use a separate -m switch for each parameter when adding the parameters below to the command line. For example: 7za a -t7z Encrypt.7z Test8.txt -mx=7 -mhe=on
7z Archive Type Supported Compression Methods: see the Choose a Compression Method section of Creating an Archive
7z Archive Type Supported Filters: Filters increase the compression ratio for some types of files. Filters must be used with one of the compression methods (for example, BCJ + LZMA). Syntax: Use one -m switch for each parameter. For example: 7z a -t7z Archive.7z TestFile.txt -m
ZIP Archive Format Parameters:
Syntax:Use the -tzip switch after the "a" command or specify "archive_name.zip" to create a Zip archive. Use a separate -m switch for each parameter when adding the parameters below to the command line. For example: 7z a -tzip Encrypt.zip Test8.txt -mx=7 -mm=Deflate64 By default (if cl and cu switches are not specified), 7-Zip uses UTF-8 encoding only for file names that contain symbols unsupported by the local code page.
Switches
Type of Archive SwitchSyntax: -t{archive_type} {archive_type} Specifies the type of archive: 7z, zip, gzip, bzip2, tar If the -t{archive_type} switch is not specified, 7-Zip uses extension of archive to detect the type of archive. Note: gzip or bzip2 formats support only one file per archive. If you want to compress more than one file to these formats, create a tar archive first, and then compress it with your selected format. -t Switch Examples: 7z a -tzip archive.zip *.txt adds all *.txt files from current directory to zip archive archive.zip. 7z t -t7z.split archive.7z.001 tests all files in archive.7z.001. It also checks that archive is multivolume .7z archive. 7z x -tiso archive.iso extracts files from archive.iso open as ISO archive. 7z x -tudf archive.iso extracts files from archive.iso open as UDF archive. Commands that can be used with this switch a (Add), d (Delete), e (Extract), l (List), t (Test), u (Update), x (Extract with full paths) Password Switch
Syntax: -p{password} -for maximum security, don't enter the password inside the switch argument; just enter "-p" to activate the switch then the program will prompt you to enter a password with echoing turned off. In this way your command-line file can't be searched for the password. -p
Switch Examples:
Commands that can be used with this switch: a (Add), d (Delete), e (Extract), t(Test), u (Update), x (Extract with full paths) Compression Method SwitchSyntax:-m Parameters must be in one of the following forms:
Compression Methods and Their Parameters LZMA Compression Method Parameters: Syntax:-m
PPMd Compression Method Parameters:
PPMd is a PPM-based algorithm based on Dmitry Shkarin's PPMdH source code. It provides a very good compression ratio for plain text files while maintaining the same speed and memory requirements for both compression and extraction.
BCJ2 Filter Parameters:
BCJ2 is a Branch converter for 32-bit x86 executables (version 2). It converts some branch instructions for increasing further compression. A BCJ2 encoder has one input stream and four output streams:
If LZMA is used with BCJ2, the size of the dictionary for streams s1 and s2 can be much smaller (512 KB is enough for most cases) than the dictionary size for stream s0. -m Switch Examples
7z a -tzip archive.zip *.jpg -mx0 adds *.jpg files to archive.zip archive without compression. 7z a -t7z archive.7z *.exe *.dll -m0=BCJ -m1=LZMA:d=21 -ms -mmt adds *.exe and *.dll files to solid archive archive.7z using LZMA method with 2 MB dictionary and BCJ converter. Compression will use multi-threading optimization. 7z a -t7z archive.7z *.exe *.dll -m0=BCJ2 -m1=LZMA:d23 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3 adds *.exe and *.dll files to archive archive.7z using BCJ2 converter, LZMA with 8 MB dictionary for main output stream (s0), and LZMA with 512 KB dictionary for s1 and s2 output streams of BCJ2. 7z a -t7z archive.7z *.txt -m0=PPMd adds *.txt files to archive archive.7z using PPMd method. Commands that can be used with this switch a (Add), d (Delete), u(Update) Create Self-Extracting Archives Switch
Syntax: -sfx[{SFX_Module}] Specifies the SFX module that will be combined with the archive. This module must be placed in the same directory as the 7z.exe. If {SFX_Module} is not assigned, 7-Zip will use standard console SFX module 7zCon.sfx.
All SFX modules are uncompressed. You can use UPX program (http://upx.sourceforge.net) to compresss such modules. After compressing by the UPX program, the size of the sfx module will be reduced to 40-50% of its original size. SFX modules for installers SFX modules for installers are included in an external package (7z_extra). You can download these modules from www.7-zip.org. SFX modules for installers (7zS.sfx and 7zSD.sfx) allow you to create your own installation program. Such a module extracts the archive to the user's temp folder, and runs a specified program, and removes the temp files after the program finishes. A self-extracting archive for installers must be created as joining 3 files: SFX_Module, Installer_Config, 7z_Archive. In addition, an optional file, Installer_Config, is allowed. You can use the following command to create an installer self-extracting archive: copy /b 7zS.sfx + config.txt + archive.7z archive.exe An optimally small installation package size can be achieved, if the installation files are uncompressed before including them in the 7z archive. -y switch for installer module specifies quiet mode extraction. Installer Config file format This config file contains commands for the Installer. The file begins with the string ;!@Install@!UTF-8! and ends with ;!@InstallEnd@!. The file must be written in UTF-8 encoding. The file contains any or all these string pairs: ID_String="Value"
You may omit any pair. There are two ways to run a installation program: RunProgram and ExecuteFile. Use RunProgram, if you want to run a program from the .7z archive. Use ExecuteFile, if you want to open a document from the .7z archive, or if you want to execute a command from Windows. If you use RunProgram, and if you specify empty directory prefix: Directory="", the system searches for the executable file in the following sequence:
Config file Examples ;!@Install@!UTF-8! Title="7-Zip 4.00" BeginPrompt="Do you want to install the 7-Zip 4.00?" RunProgram="setup.exe" ;!@InstallEnd@! ;!@Install@!UTF-8! Title="7-Zip 4.00" BeginPrompt="Do you want to install the 7-Zip 4.00?" ExecuteFile="7zip.msi" ;!@InstallEnd@! ;!@Install@!UTF-8! Title="7-Zip 4.01 Update" BeginPrompt="Do you want to install the 7-Zip 4.01 Update?" ExecuteFile="msiexec.exe" ExecuteParameters="/i 7zip.msi REINSTALL=ALL REINSTALLMODE=vomus" ;!@InstallEnd@! -sfx Switch Examples 7z a -sfx a.exe *.txt adds *.txt files to self extracting archive a.exe using the default console SFX module. 7z a -sfx7z.sfx a.exe * adds all files to self extracting archive a.exe with module 7z.sfx using windows version of SFX mudule. Commands that can be used with this switch a (Add), d (Delete), u (Update) Update Options Switch
Syntax: -u[-] Multiple update switches are supported. 7-Zip can create any number of new archives during one operation. Time Dependent Considerations: see "Time Dependent Considerations", above, for possible time conflicts when creating updates. Parameters: If you don't specify a !{new_archive_name} option, then all options will refer to the main archive (the archive assigned on the command line after the 7z command). If you specify !{new_archive_name} option, then 7-Zip also will create a new archive with the specified name and all options will refer to that new archive. " - " - Disables any updates in the base archive which is the archive assigned by "base_archive_name" on the command line. See Command line syntax for more details. {new_archive_name} - Specifies the path name of the new archive to be created. All options in this switch will refer to this new archive. If not assigned, then all options in this switch will refer to the base archive of the command.
For each unique filename there are 6 variants of state:
Actions:
Any update command (such as a (Add), d (Delete), u (Update)) can be assigned with variants of Actions. Variants of Actions for commands that use the update switch (a, d, u):
-u Switch Examples
7z u c:\1\exist.7z -u- -up0q3x2z0!c:\1\update.7z * creates a new archive update.7z and writes to this archive all files from current directory which differ from files in exist.7z archive. exist.7z archive will not be changed. 7z u c:\1\exist.7z -up0q3x2z0!c:\1\update.7z * -ms=off creates a new archive update.7z and writes to this archive all files from the current directory which differ from files in exist.7z archive. Note: The current version of 7-Zip cannot change an archive created with the solid option switched on. To update a .7z archive, you must create and update the archive in non-solid mod (-ms=off switch). Commands that can be used with this switch: a (Add), d (Delete), u (Update), Exit Codes from 7-Zip7-Zip returns the following exit codes:
Archive Format Comparison7z (7ZIP's native format), TAr and ZIP formats are available with various compression methods. See Type of Archive Switch for additional information.
Archive Types in Detail
7z Archives
Compression Level Parameter for 7z Archives: x=[0 | 1 | 3 | 5 | 7 | 9 ] Sets the level of compression.
Solid Mode Parameter for 7z Archives: s=[off | on | [e] [{N}f] [{N}b | {N}k | {N}m | {N}g)] Enables or disables solid mode. The default mode is s=on. In solid mode, files are grouped together. Usually, compressing in solid mode improves the compression ratio.
Solid Block Size: Limitation of the solid block size usually decreases compression ratio but gives the following advantages:
The current version of 7-Zip doesn't support updating of solid archives, if it requires repacking solid blocks. Eg: s=100f10m sets solid mode with 100 files & 10 MB limits per one solid block. These are the default limits for the solid block size:
f=[off | on] Parameter for 7z Archives: Enables or disables compression filters for executable files: dll, exe, ocx, sfx, sys. It uses BCJ2 filter in Ultra mode and BCJ filter in other modes. The default mode is f=on. hc=[off | on] Parameter for 7z Archives:Enables or disables archive header compressing. The default mode is hc=on. If archive header compressing is enabled, some parts of archive header will be compressed with LZMA method. he=[off | on] Parameter for 7z Archives:Enables or disables archive header encryption. The default mode is he=off. Sets order of methods. It is used also to associate parameters with methods. Numbers must begin from 0. Methods that have smaller numbers will be used before others. b{C1}[s{S1}]:{C2}[s{S2}] Parameter for 7z Archives:Binds output stream S1 in coder C1 with input stream S2 in coder C2. If stream number is not specified, stream with number 0 will be used. Usally coder has one input stream and one output stream. In 7z some coders can have multiple input and output streams. For example, BCJ2 encoder has one input stream and four output streams. mt=[off | on | {N}] Parameter for 7z Archives:Sets multithread mode. If you have a multiprocessor or multicore system, you can get a increase with this switch. 7-Zip supports multithread mode only for LZMA compression and BZip2 compression / decompression. If you specify {N}, for example mt=4, 7-Zip tries to use 4 threads. LZMA compression uses only 2 threads.
Sets compression method. You can use any number of methods. The default method is LZMA. Parameters must be in one of the following forms:
Supported methods for 7z Archives:
Supported filters for 7z Archives: Filters increase the compression ratio for some types of files. Filters must be used with one of the compression method (for example, BCJ + LZMA).
BZIP2 Archives
Compression Level Parameter for BZIP2 Archives: x=[1 | 3 | 5 | 7 | 9 ] Sets the level of compression:
Sets the number of passes. It can be in the range from 1 to 10. The default value is 1 for normal mode, 2 for maximum mode and 7 for ultra mode. A bigger number can give a little bit better compression ratio but a slower compression process. mt=[off | on | {N}] Parameter for BZIP2 Archives:Sets multi-thread mode. If you have a multiprocessor or multicore system, you can get a speed increase with this switch. If you specify {N}, for example mt=4, 7-Zip tries to use 4 threads. GZIP ArchivesGZIP uses the same parameters as ZIP, but GZIP compresses only with Deflate method. ZIP Archives
By default (if cl and cu switches are not specified), 7-Zip uses UTF-8 encoding only for file names that contain symbols unsupported by the local code page. Compression Level Parameter for ZIP Archives: x=[0 | 1 | 3 | 5 | 7 | 9 ] Sets level of compression. x=0means Copymode(no compression). ZIP Archive Available Compression Methods 1. Deflate / Deflate64 settings for ZIP Archives: x=1 and x=3 with Deflate method set fast mode for compression.
2. BZip2 settings for ZIP Archives:
Sets the number of fast bytes for the Deflate/Deflate64 encoder. It can be in the range from 3 to 258 (257 for Deflate64). Usually, a big number gives a little bit better compression ratio and a slower compression process. A large fast bytes parameter can significantly increase the compression ratio for files which contain long identical sequences of bytes. pass={NumPasses} Parameter for ZIP Archives using BZip2:Sets number of passes for Deflate encoder. It can be in the range from 1 to 15 for Deflate and from 1 to 10 for BZip2. Usually, a big number gives a little bit better compression ratio and a slower compression process.
d={Size}[b|k|m] Parameter for ZIP Archives using BZip2 Sets the Dictionary size for BZip2. You must specify the size in bytes, kilobytes, or megabytes. The maximum value for the Dictionary size is 900000b. If you do not specify any symbol from set [b|k|m], dictionary size will be calculated as DictionarySize = 2^Size bytes. mt=[off | on | {N}] Parameter for ZIP Archives using BZip2: Sets multi-thread mode. If you have a multiprocessor or multicore system, you can get a speed increase with this switch. This option affects only compression (with any method) and decompression of BZip2 streams. Each thread in the multithread mode uses 32 MB of RAM for buffering. If you specify {N}, 7-Zip tries to use N threads. Compression Methods in Detail
BZIP2 Compression MethodBZIP2 uses the BWT algorithm for compression providing fast speeds and relatively good compression ratios.
Sets the number of passes. It can be in the range from 1 to 10. The default value is 1 for normal mode, 2 for maximum mode and 7 for ultra mode. A bigger number can give a little bit better compression ratio and a slower compression process.
Sets multithread mode. If you have a multiprocessor or multicore system, you can get a speed increase with this switch. If you specify {N}, for example mt=4, 7-Zip tries to use 4 threads. Deflate and Deflate64 Compression MethodsDeflate employs the LZ77 algorithm providing relatively quick speeds and moderate compression ratios. Deflate64 increases the dictionary size for Deflate and achieves better compression. Deflate/Deflate64 Settings:
GZipGZip uses the same parameters as Zip, but GZip compresses only with Deflate method in the 7Zip Windows graphic user interface version. Command line version uses GZip method or Deflate. LZMA Compression MethodLZMA is the default and general compression method of 7z format. The main features of the LZMA method:
LZMA is based on Lempel-Ziv algorithm that provides very fast decompression (about 10-20 times faster than compression). Memory requirements for compression and decompression also are different (see d={Size}[b|k|m] switch for details).
Sets compression mode: 0 = fast, 1 = normal. Default value is 1. d={Size}[b|k|m]Sets Dictionary size for LZMA. You must specify the size in bytes, kilobytes, or megabytes. The maximum value for dictionary size is 1 GB = 2^30 bytes. Default values for LZMA are 24 (16 MB) in normal mode, 25 (32 MB) in maximum mode (-mx=7) and 26 (64 MB) in ultra mode (-mx=9). If you do not specify any symbol from the set [b|k|m], the dictionary size will be calculated as DictionarySize = 2^Size bytes. For decompressing a file compressed by LZMA method with dictionary size N, you need about N bytes of memory (RAM) available. mf={MF_ID}Sets Match Finder for LZMA. Default method is bt4. Algorithms from hc* group don't provide a good compression ratio, but they often work pretty fast in combination with fast mode (a=0). Memory requirements depend on dictionary size (parameter "d" in table below).
Note: Your operation system also needs some amount of physical memory for internal purposes. So keep at least 32MB of physical memory unused. fb={N}Sets number of fast bytes for LZMA. It can be in the range from 5 to 273. The default value is 32 for normal mode and 64 for maximum and ultra modes. Usually, a big number gives a little bit better compression ratio and slower compression process. mc={N}Sets number of cycles (passes) for match finder. It can be in range from 0 to 1000000000. Default value is (16 + number_of_fast_bytes / 2) for BT* match finders and (8 + number_of_fast_bytes / 4) for HC4 match finder. If you specify mc=0, LZMA will use default value. Usually, a big number gives a little bit better compression ratio and slower compression process. For example, mf=HC4 and mc=10000 can provide almost the same compression ratio as mf=BT4. lc={N}Sets the number of literal context bits (high bits of previous literal). It can be in range from 0 to 8. Default value is 3. Sometimes lc=4 gives gain for big files. lp={N}Sets the number of literal pos bits (low bits of current position for literals). It can be in the range from 0 to 4. The default value is 0. The lp switch is intended for periodical data when the period is equal to 2^value (where lp=value). For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's better to set lc=0, if you change lp switch. pb={N}Sets the number of pos bits (low bits of current position). It can be in the range from 0 to 4. The default value is 2. The pb switch is intended for periodical data when the period is equal 2^value (where lp=value). PPMd Compression MethodPPMd is a PPM-based algorithm and provides a very good compression ratio and speed for plain text files. Compression/decompression speeds and memory requirements are identical.
mem={Size}[b|k|m] Sets the size of memory used for PPMd. You must specify the size in bytes, kilobytes, or megabytes. The maximum value is 2GB = 2^31 bytes. The default value is 24 (16MB). If you do not specify any symbol from the set [b|k|m], the memory size will be calculated as (2^Size) bytes. PPMd uses the same amount of memory for compression and decompression. o={Size} Sets the model order for PPMd. The size must be in the range [2,32]. The default value is 6. Compression Method Filters
How do I run bzip2 on Windows?How to open BZ2 files. Save the . ... . Launch WinZip from your start menu or Desktop shortcut. ... . Select all the files and folders inside the compressed file. ... . Click 1-click Unzip and choose Unzip to PC or Cloud in the WinZip toolbar under the Unzip/Share tab.. What is bzip2 file?August 2021) bzip2 is a free and open-source file compression program that uses the Burrows–Wheeler algorithm. It only compresses single files and is not a file archiver. It was developed by Julian Seward, and maintained by Mark Wielaard and Micah Snyder. bzip2.
What does bzip2 mean Linux?bzip2 command in Linux is used to compress and decompress the files i.e. it helps in binding the files into a single file which takes less storage space as the original file use to take. It has a slower decompression time and higher memory use.
|