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
Name of the archive to test. Auto-detects archive type.
Specific files or patterns to test. If omitted, tests all files.Example:
*.txt or documents/report.pdfProvide password for encrypted archives.Example:
-pMyPassword or -p (prompts)Recurse subdirectories (enabled by default).
Exclude files from testing by pattern.Example:
-x!*.tmpInclude only files matching pattern.Example:
-i!*.txtSpecify archive type (usually auto-detected).Example:
-t7zSet hash function for testing: CRC32, CRC64, SHA256, SHA1, etc.Example:
-scrcSHA256Disable progress indicator.
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:| Code | Meaning | Description |
|---|---|---|
| 0 | Success | Archive is OK, no errors |
| 1 | Warning | Non-fatal errors (some files may be OK) |
| 2 | Fatal Error | Archive is corrupted or unreadable |
| 7 | Command Line Error | Invalid command syntax |
| 8 | Not Enough Memory | Insufficient memory to test |
| 255 | User Stopped | User interrupted the process |
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