Tôi muốn có thể chạy 7zip từ dòng lệnh trên máy Mac. Có ai có hướng dẫn về cách thiết lập này?
Tôi muốn có thể chạy 7zip từ dòng lệnh trên máy Mac. Có ai có hướng dẫn về cách thiết lập này?
Để cài đặt p7zip sử dụng Homebrew, trước tiên hãy cập nhật brew
công thức để chắc chắn bạn đang nhận được p7zip
.
$ brew update
Sử dụng Homebrew để cài đặt p7zip
:
$ brew install p7zip
Thêm tất cả các tệp trong sputnik
thư mục vào tệp nén heed.7z
:
$ 7z a heed.7z sputnik
Giải nén heed.7z
:
$ 7z x heed.7z
Trên tải xuống trang 7-zip, có một số tùy chọn cho OS X. Thật không may, họ dường như với một GUI, hoặc không có sẵn tại thời điểm này.
Bạn có thể tải xuống p7zip.
p7zip là phiên bản dòng lệnh 7-Zip cho Unix / Linux, được tạo bởi một nhà phát triển độc lập
Nó được phân phối dưới dạng nhị phân Linux và ở dạng mã nguồn trên Sourceforge.
Tải xuống mã nguồn và chạy make
trong thư mục bạn trích xuất lưu trữ. Nó sẽ tự động xây dựng 7za
cho hệ điều hành của bạn. Bạn có thể cần Xcode và các công cụ dòng lệnh của nó để làm việc này.
$ 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
Nếu bạn chỉ cần trích xuất lưu trữ, unar (một phiên bản dòng lệnh của The Unarchiver) cũng hỗ trợ 7zip.