cabextract
Extract files from Microsoft Cabinet (.cab) archives
SYNOPSIS
cabextract [OPTIONS] <CAB_FILE> [<FILE_TO_EXTRACT> ...]
cabextract -l <CAB_FILE>
PARAMETERS
-d <directory>
Extract files into the specified <directory>. If the directory does not exist, cabextract will attempt to create it.
-F <pattern>
--filter <pattern>
Extract only files matching the specified <pattern>. Wildcards (e.g., *, ?) are supported. This option can be used multiple times to specify multiple patterns for extraction.
-f
Force overwrite existing files without prompting for confirmation. Use with caution as it can lead to data loss.
-L
-l
List the contents of the archive without performing any extraction. This is equivalent to --list and displays file names, sizes, and dates within the CAB file.
-q
Enable quiet mode, suppressing most output during operation. Only critical errors will be displayed.
-s
Don't create subdirectories; extract all files directly into the specified (or current) output directory, flattening the archive's directory structure.
-V
Display version information of cabextract and the underlying libmspack library, then exit.
-v
Enable verbose mode, displaying more detailed information during extraction, such as file names, sizes, and progress.
-h
Display a help message with command usage and available options, then exit.
DESCRIPTION
cabextract is a command-line utility designed to extract files from Microsoft Cabinet archives (files typically ending with the .CAB extension). These archives are commonly used by Microsoft for software distribution, Windows installation files, and device drivers.
cabextract can handle various compression methods used within CAB files, including MSZIP, LZX, and Quantum compression, as well as uncompressed data. It does not support creating .CAB archives, focusing solely on extraction. It's particularly useful on Linux and Unix-like systems for accessing content from Windows-specific archives without needing Windows itself. It provides options for specifying the output directory, filtering files to extract, and listing archive contents.
CAVEATS
cabextract is an extraction-only tool; it cannot create Microsoft Cabinet archives. It also does not support self-extracting CAB files (SFX), which typically require execution on a Windows environment or a specific SFX extractor. While generally robust, it might not perfectly handle all malformed or highly obscure CAB file variations.
SPECIFIC FILE EXTRACTION
You can extract specific files from a CAB archive by listing their names as arguments after the CAB_FILE. For example, to extract only file1.txt and file2.dll from archive.cab, you would use: cabextract archive.cab file1.txt file2.dll.
WILDCARD SUPPORT WITH -F
The -F (or --filter) option supports standard shell-style wildcards such as * (matches any sequence of characters) and ? (matches any single character) to filter files during extraction. This allows for flexible pattern-based selection of files to extract.
HISTORY
cabextract is an integral part of the libmspack project, a free software library dedicated to handling various Microsoft proprietary file formats, including Cabinet (.CAB) files, CHM files, and others. The development of libmspack and its accompanying tools like cabextract was driven by the necessity for interoperability and access to these formats on non-Windows operating systems, particularly Linux and Unix-like environments. It emerged as a crucial utility for users needing to extract software, drivers, or system files distributed in Microsoft's native archive format, filling a gap in cross-platform compatibility.