티스토리 뷰

terminal 에서 기본 제공하는 zip 명령어로 (분할)압축 하기

1. 터미널 실행

2. 압축하고자 하는 폴더(또는 파일)이 위치한 경로로 이동

3. 명령어 실행

zip -r -s 5m z example-dir/

 

4. z.z01, z.z02 ... z.zn, z.zip 파일 생성

 

* 설명

z 위치에는 새로 생성하고자 하는 zip 파일명 입력 (.zip 이 알아서 붙음)

example-dir/  위치에는 압축하고자 하는 폴더나 파일명 입력

-r는 subdirs를 위해서 사용하고, 생략 가능함

-s는 분할을 위해서 사용하고, 생략 가능함. 사용할 때는 뒤에 숫자와 단위 사용하는데 m이 기본값. 위 명령어에서는 5MB씩 분할

 

#참고
zip -h2

........ 

Basic command line:
  zip options archive_name file file ...

Basic options:
Some examples:
  Add file.txt to z.zip (create z if needed):      zip z file.txt
  Zip all files in current dir:                    zip z *
  Zip files in current dir and subdirs also:       zip -r z .
  
........

Splits (archives created as a set of split files):
  -s ssize  create split archive with splits of size ssize, where ssize nm
              n number and m multiplier (kmgt, default m), 100k -> 100 kB

........

 

 

분할된 압축파일 풀기

1. 터미널 실행

2. 압축풀고자 하는 폴더(또는 파일)이 위치한 경로로 이동

3. 명령어 실행

zip -FF z.zip --out zz

4. zz.zip 파일이 생성되면 finder에서 압축해제가 가능하다

 

* 설명

-FF는 온전하지 않은 파일을 try to fix 하는 옵션이다

- z.z01, z.z02 ... z.zn, z.zip 의 분할된 파일이 있다면 최종 z.zip 파일만 -FF 뒤에 입력한다

- --out 뒤에는 새롭게 생성될 파일 명을 입력한다

 

 

 

 

#참고

https://linuxconfig.org/how-to-split-zip-archive-into-multiple-blocks-of-a-specific-size

 

How to split zip archive into multiple blocks of a specific size

How to split zip archive into multiple blocks of a specific size

linuxconfig.org

https://dbjina.tistory.com/53

 

Mac에서 분할압축된 zip 파일 풀기

Mac에서 The Unarchiver App 으로 z01, zip 으로 분할압축된 파일을 풀려고 하였으나 몇가지 작업을 해줘야 풀 수 있었습니다. Mac에서도 반디집을 설치해서 하면 편하게 될거 같긴한데 22,000원으로 가격

dbjina.tistory.com

 

 

댓글