← 返回命令列表

Linux command

lsar 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

List archive contents

lsar [archive.zip]

List with detailed info

lsar -l [archive.rar]

List very long format

lsar -L [archive.7z]

Test archive integrity

lsar -t [archive.zip]

List with password

lsar -p [password] [encrypted.zip]

List specific encoding

lsar -e [shift_jis] [japanese.zip]

Print only filenames

lsar -1 [archive.tar.gz]

说明

lsar lists the contents of archive files. It supports a wide variety of formats including Zip, RAR, 7-Zip, tar, gzip, bzip2, ISO, and many legacy formats. The tool is part of The Unarchiver suite. While unar extracts files, lsar provides inspection without extraction. It handles archives that standard tools may fail on, including corrupted or non-standard archives. Encoding detection handles international filenames automatically. For archives with mislabeled encodings, the -e flag forces specific character sets like Shift_JIS, GBK, or EUC-KR. Long listing shows file sizes (compressed and uncompressed), modification dates, and permissions where available. The test mode (-t) verifies archive integrity without extracting. JSON output enables scripting and integration with other tools.

参数

-l
Long listing with size, date, permissions.
-L
Very long listing with extra details.
-t
Test archive integrity.
-p _PASSWORD_
Specify password for encrypted archives.
-e _ENCODING_
Force character encoding for filenames.
-1
Print only filenames, one per line.
-j
Output as JSON.
-q
Quiet mode.
-nr
Don't recurse into nested archives.
-h, --help
Show help.

FAQ

What is the lsar command used for?

lsar lists the contents of archive files. It supports a wide variety of formats including Zip, RAR, 7-Zip, tar, gzip, bzip2, ISO, and many legacy formats. The tool is part of The Unarchiver suite. While unar extracts files, lsar provides inspection without extraction. It handles archives that standard tools may fail on, including corrupted or non-standard archives. Encoding detection handles international filenames automatically. For archives with mislabeled encodings, the -e flag forces specific character sets like Shift_JIS, GBK, or EUC-KR. Long listing shows file sizes (compressed and uncompressed), modification dates, and permissions where available. The test mode (-t) verifies archive integrity without extracting. JSON output enables scripting and integration with other tools.

How do I run a basic lsar example?

Run `lsar [archive.zip]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l do in lsar?

Long listing with size, date, permissions.