Pau*_*ake 233 terminal.app 7-zip macos
我希望能够从 Mac 上的命令行运行 7zip。有没有人有关于如何设置的说明?
Tro*_*vey 387
要使用Homebrew安装p7zip,首先更新您的公式以确保您获得最新的.brew
p7zip
$ brew update
Run Code Online (Sandbox Code Playgroud)
使用 Homebrew 安装p7zip
:
$ brew install p7zip
Run Code Online (Sandbox Code Playgroud)
将sputnik
目录中的所有文件添加到压缩文件中heed.7z
:
$ 7z a heed.7z sputnik
Run Code Online (Sandbox Code Playgroud)
解压heed.7z
:
$ 7z x heed.7z
Run Code Online (Sandbox Code Playgroud)
Dan*_*eck 43
在7-zip的下载页面上,有几个适用于 OS X 的选项。不幸的是,它们似乎带有 GUI,或者目前不可用。
不过你可以下载p7zip。
p7zip 是 Unix/Linux 的 7-Zip 命令行版本,由独立开发者制作
它在 Sourceforge 上以 Linux 二进制文件和源代码形式分发。
下载源代码,并make
在您将存档解压缩到的文件夹中运行。它将自动7za
为您的操作系统构建。您可能需要 Xcode 及其命令行工具才能工作。
$ cd Downloads/p7zip_9.20.1
$ make
[...]
$ cd bin
$ ls
7za
$ ./7za
7-Zip (A) [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)
Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
[<@listfiles...>]
<Commands>
a: Add files to archive
b: Benchmark
d: Delete files from archive
e: Extract files from archive (without using directory names)
l: List contents of archive
t: Test integrity of archive
u: Update files to archive
x: eXtract files with full paths
<Switches>
-ai[r[-|0]]{@listfile|!wildcard}: Include archives
-ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
-bd: Disable percentage indicator
-i[r[-|0]]{@listfile|!wildcard}: Include filenames
-m{Parameters}: set compression Method
-o{Directory}: set Output directory
-p{Password}: set Password
-r[-|0]: Recurse subdirectories
-scs{UTF-8 | WIN | DOS}: set charset for list files
-sfx[{name}]: Create SFX archive
-si[{name}]: read data from stdin
-slt: show technical information for l (List) command
-so: write data to stdout
-ssc[-]: set sensitive case mode
-t{Type}: Set type of archive
-u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
-v{Size}[b|k|m|g]: Create volumes
-w[{path}]: assign Work directory. Empty path means a temporary directory
-x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
-y: assume Yes on all queries
$ ./7za a 7za.7z 7za
7-Zip (A) [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)
Scanning
Creating archive 7za.7z
Compressing 7za
Everything is Ok
$ ls
7za 7za.7z
Run Code Online (Sandbox Code Playgroud)
p7zip
不再维护。多年来一直是 17.xx。7zip 的地址为 23.xx。它缺少重要的功能,例如利用所有 CPU 核心(7zip 17.xx 是单核)
brew install sevenzip
将安装仍由原始开发人员维护的软件包 ( https://7-zip.org )。
要使用,7zz --help
归档时间: |
|
查看次数: |
234628 次 |
最近记录: |