macOS命令行unar解压7z文件(3)

2024-02-06
#Unix #Shell

unar 1 是 The Unarchiver 提供的命令行解压工具,可以在各个系统里运行。

  1. 先下载 unarMac.zip 文件,解压后有两个文件:unarlsar

  2. unarlsar 移动到路径 /Applications/The Unarchiver.app/Contents/MacOS/,并添加到系统 PATH 中:

echo 'export PATH="/Applications/The Unarchiver.app/Contents/MacOS/:$PATH"' >> ~/.zshrc
source ~/.zshrc
  1. 说明:

unar:

unar v1.10.1 (May 19 2016), a tool for extracting the contents of archive files.
Usage: unar [options] archive [files ...]

lsar:

lsar v1.10.1 (May 19 2016), a tool for listing the contents of archive files.
Usage: lsar [options] archive [files ...]

参考

  1. Unar and Lsar | Command Line Tools for The Unarchiver
  2. The Unarchiver | Top Free Unarchiving Software for macOS