t (test) command verifies the integrity of archives by checking checksums and attempting decompression without writing files to disk.
Syntax
Description
The test command:- Verifies archive structure and headers
- Checks CRC checksums for all files
- Tests decompression without extracting to disk
- Detects corruption, errors, or incomplete archives
- Works with encrypted archives (requires password)
- Can test specific files or entire archives
Common Options
string
required
Name of the archive to test. Auto-detects archive type.
string
Specific files or patterns to test. If omitted, tests all files.Example:
*.txt or documents/report.pdfstring
Provide password for encrypted archives.Example:
-pMyPassword or -p (prompts)flag
Recurse subdirectories (enabled by default).
string
Exclude files from testing by pattern.Example:
-x!*.tmpstring
Include only files matching pattern.Example:
-i!*.txtstring
Specify archive type (usually auto-detected).Example:
-t7zstring
Set hash function for testing: CRC32, CRC64, SHA256, SHA1, etc.Example:
-scrcSHA256flag
Disable progress indicator.
number
Set output log level (0=quiet, 1=errors, 2=errors+warnings, 3=verbose).
Examples
Test entire archive
Test password-protected archive
Test specific files
Test files by pattern
Test excluding certain files
Test quietly (exit code only)
Test with verbose output
Test multi-volume archive
Test multiple archives
Test with SHA256 checksums
Exit Codes
The test command returns exit codes that indicate test results:Testing Strategies
Quick Test Script
Test All Archives in Directory
Test and Log Results
Test Before Extraction
Advanced Examples
Test with progress to file
Test and capture errors
Parallel testing of multiple archives
Test archive chain
Understanding Test Results
Successful Test
CRC Error
Data Error
Headers Error
Wrong Password
Unsupported Method
Testing Different Archive Types
Test ZIP archive
Test RAR archive
Test TAR.GZ archive
Test ISO image
Test self-extracting archive
Test split archive
Automated Testing
Cron Job for Regular Testing
Test with Timeout
Test and Compare Checksums
The test command reads and decompresses files but does not write them to disk, making it safe to run on any archive without worrying about disk space or file conflicts.
Performance Considerations
- Testing is faster than extraction (no disk writes)
- Solid archives must decompress sequentially (slower)
- Multi-volume archives test faster with all volumes present
- Encrypted archives require full decompression (slower)
- Password-protected headers require password even for testing
Related Commands
- Extract Command (x, e) - Extract files from archive
- List Command (l) - View archive contents
- Hash Command (h) - Calculate file checksums