OS X의 터미널에서 실행할 수 있도록 7zip을 설치하는 방법

OS X의 터미널에서 실행할 수 있도록 7zip을 설치하는 방법

Mac의 명령줄에서 7zip을 실행할 수 있기를 원합니다. 누구든지 이것을 설정하는 방법에 대한 지침을 갖고 있습니까?

답변1

설치하기 위해서p7zip사용하여홈브류, 먼저 brew수식을 업데이트하여 최신 정보를 얻으세요 p7zip.

$ brew update

Homebrew를 사용하여 설치하십시오 p7zip.

$ brew install p7zip

디렉터리 의 모든 파일을 sputnik압축 파일에 추가합니다 heed.7z.

$ 7z a heed.7z sputnik

압축을 푼다 heed.7z:

$ 7z x heed.7z

답변2

7-zip 다운로드 페이지, OS X에는 여러 가지 옵션이 있습니다. 불행히도 GUI가 포함되어 있거나 현재 사용할 수 없는 것 같습니다.


그래도 p7zip을 다운로드할 수 있습니다.

p7zip은 독립 개발자가 만든 Unix/Linux용 7-Zip의 명령줄 버전입니다.

Linux 바이너리와 소스코드 형태로 배포됩니다.소스포지에서.

소스 코드를 다운로드하고 make아카이브를 추출한 폴더에서 실행하십시오. 7zaOS에 맞게 자동으로 빌드됩니다 . 이 작업을 수행하려면 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

답변3

아카이브만 추출해야 하는 경우,unar(The Unarchiver의 명령줄 버전)도 7zip을 지원합니다.

답변4

p7zip더 이상 유지되지 않습니다. 수년간 17.xx였습니다. 7zip은 23.xx에 있습니다. 모든 CPU 코어 활용과 같은 중요한 기능이 누락되었습니다(7zip 17.xx는 단일 코어임).

brew install sevenzip원래 개발자가 계속 관리하는 패키지를 설치합니다(https://7-zip.org).

사용,7zz --help

관련 정보