l (list) command displays the contents of an archive with detailed information about files, compression ratios, and archive properties.
Syntax
Description
The list command provides information about:- Files and directories in the archive
- File sizes (uncompressed and compressed)
- Compression ratios
- File attributes and timestamps
- Archive metadata and properties
- Encryption status
Common Options
string
required
Name of the archive to list. 7-Zip auto-detects the archive type.
string
Specific files or patterns to list. If omitted, lists all files.Example:
*.txt or documents/string
Provide password for encrypted archives.Example:
-pMyPassword or -p (prompts)flag
Show technical information for each file (detailed mode).
string
Set archive type (usually auto-detected).Example:
-t7zstring
Exclude files from listing by pattern.Example:
-x!*.tmpstring
Include only files matching pattern.Example:
-i!*.txtflag
Recurse subdirectories (enabled by default).
string
Include archives by pattern.
string
Exclude archives by pattern.
Examples
Basic listing
List with technical details
List specific files
List files in directory
List encrypted archive
List excluding certain files
List only specific file types
List multiple archives
Understanding the Output
Standard Listing Columns
File Attributes
- D - Directory
- R - Read-only
- H - Hidden
- S - System
- A - Archive
- . - Attribute not set
Archive Properties
- Type - Archive format (7z, ZIP, RAR, etc.)
- Physical Size - Actual archive file size
- Headers Size - Size of archive metadata
- Method - Compression method used
- Solid - Whether archive is solid
- Blocks - Number of solid blocks
Technical Listing (-slt)
The-slt switch provides detailed information for each file:
string
Full path of the file within archive
boolean
Whether entry is a folder (+) or file (-)
number
Uncompressed size in bytes
number
Compressed size in bytes
datetime
Last modification timestamp
string
File system attributes
string
CRC32 checksum (hexadecimal)
boolean
Whether file is encrypted (+) or not (-)
string
Compression method and dictionary size
number
Solid block number
Advanced Examples
List with grep filtering
Count files in archive
List only directories
Calculate total uncompressed size
List sorted by size (with parse)
Working with Different Archive Types
List ZIP archive
List TAR archive
List TAR.GZ archive
List RAR archive
List ISO image
List multi-volume archive
List self-extracting archive
Scripting with List Command
Check if file exists in archive
Extract archive metadata
List to file
Parse technical listing
The list command does not extract any files. It only reads the archive’s central directory/headers, making it very fast even for large archives.
Related Commands
- Extract Command (x, e) - Extract files from archive
- Test Command (t) - Test archive integrity
- Add Command (a) - Create archives