Linux command
unar 命令
网络
复制后可按需替换文件名、目录或参数。
常用示例
Extract archive
unar [archive.zip]
Extract to directory
unar -o [output_dir] [archive.rar]
Extract with password
unar -p [password] [encrypted.zip]
Force overwrite
unar -f [archive.zip]
Extract without directory
unar -D [archive.tar.gz]
List contents only
lsar [archive.7z]
Extract specific encoding
unar -e [shift_jis] [japanese.zip]
说明
unar extracts archives of many formats. It handles Zip, RAR, 7-Zip, tar, gzip, bzip2, ISO, and many legacy formats. Format detection is automatic. The tool examines archive contents rather than relying solely on extensions. Encoding handling processes international filenames correctly. Japanese, Chinese, Korean, and other encodings are supported and auto-detected. Password handling works for encrypted archives. Both header-encrypted and content-encrypted formats are supported. The tool handles broken or non-standard archives that other extractors reject. It attempts to recover what it can. By default, archives extract to a directory named after the archive. This can be controlled with -d or -D options.
参数
- -o _DIR_
- Output directory.
- -p _PASSWORD_
- Archive password.
- -e _ENCODING_
- Filename encoding.
- -f, --force
- Overwrite without asking.
- -D, --no-directory
- Don't create containing directory.
- -d, --directory
- Always create directory.
- -k _MODE_
- How to handle existing files.
- -q, --quiet
- Quiet mode.
- -t, --test
- Test archive.
- -nr, --no-recursion
- Don't extract nested archives.
- -h, --help
- Show help.
FAQ
What is the unar command used for?
unar extracts archives of many formats. It handles Zip, RAR, 7-Zip, tar, gzip, bzip2, ISO, and many legacy formats. Format detection is automatic. The tool examines archive contents rather than relying solely on extensions. Encoding handling processes international filenames correctly. Japanese, Chinese, Korean, and other encodings are supported and auto-detected. Password handling works for encrypted archives. Both header-encrypted and content-encrypted formats are supported. The tool handles broken or non-standard archives that other extractors reject. It attempts to recover what it can. By default, archives extract to a directory named after the archive. This can be controlled with -d or -D options.
How do I run a basic unar example?
Run `unar [archive.zip]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o _DIR_ do in unar?
Output directory.