7zip(p7zip) on CentOS 7
리눅스(CentOS) 에서 윈도우로 특정 디렉토리를 이동시킬때, 보통 디렉토리를 압축해서 하나의 파일로 저장해서 scp 나 ftp 로 전송했었다. 옛날 사람이라서 그런지, 항상 tar 로 디렉토리의 파일들을 묶어서 gzip 으로 압축하거나 또는 tar cvfz 로 압축하면서 파일들을 묶었는데 윈도우에서 안풀리는 경우가 있다.
(알집 같은거를 사용하면 taz 나 tar.gz 파일을 인식해서 잘 풀어주기는 한다. 그러나 회사에서 무료 버전 알집을 그냥 설치하기엔 문제가 있을거 같다.)
그래서 요새 많이 사용하는 7zip 이 없을까 싶어서 찾았는데, p7zip 이라는 게 있다. zip 파일 뿐만 아니라 .7z 라는 자체 압축 포맷도 가지고 있다.
그리고, 무엇보다도 큰 장점이 압축 해제 속도가 빠르다. 물론 압축파일안에 포함된 내용에 따라 편차가 있겠지만 보통 10 GB 이상의 파일을 unzip 앱으로 풀면 생각보다 오래 걸린다. 하드웨어 스펙에 따라 다르겠지만 8분이상 넘는걸 보게 되는데, 7zip 을 사용해서 unzip 을 하면 1~3 분대로 끝나는 거를 볼 수 있다. 7zip 이 멀티 코어를 활용해서 인데, 가장 큰 장점이지 않을 까 싶다.
# yum search 7zip
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.kakao.com
* epel: mirror.premi.st
* extras: mirror.kakao.com
* updates: mirror.kakao.com
============================================================== N/S matched: 7zip ===============================================================
p7zip-plugins.x86_64 : Additional plugins for p7zip
p7zip.x86_64 : Very high compression ratio file archiver
p7zip-doc.noarch : Manual documentation and contrib directory
p7zip-gui.x86_64 : 7zG - 7-Zip GUI version
p7zip 패키지를 설치하고나서 당연히 7zip, p7zip 인줄 알고 command 명령어를 못찾아서 당황스러웠는데, 7za 였다.
# which 7zip
/usr/bin/which: no 7zip in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
# which p7zip
/usr/bin/which: no p7zip in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
# 7z
bash: 7z: 명령을 찾을 수 없습니다...
# 7za
7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=ko_KR.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (306C3),ASM,AES-NI)
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)
h : Calculate hash values for files
i : Show information about supported formats
l : List contents of archive
rn : Rename files in archive
t : Test integrity of archive
u : Update files to archive
x : eXtract files with full paths
압축/해제 옵션은 다른 zip 류와 동일하게 a/x 로 되어있다. 'l' 옵션으로 압축된 파일들을 확인할 수 있다.
# 7za a test.7z testDir/
7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=ko_KR.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (306C3),ASM,AES-NI)
Scanning the drive:
366 folders, 638 files, 93708089 bytes (90 MiB)
Creating archive: test.7z
Items to compress: 1004
Files read from disk: 637
Archive size: 39790430 bytes (38 MiB)
Everything is Ok
# 7za l test.7z
7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=ko_KR.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (306C3),ASM,AES-NI)
Scanning the drive for archives:
1 file, 39790430 bytes (38 MiB)
Listing archive: test.7z
--
Path = test.7z
Type = 7z
Physical Size = 39790430
Headers Size = 9864
Method = LZMA2:24
Solid = +
Blocks = 1
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2018-04-19 02:47:08 D.... 0 0 testDir
2018-04-19 02:47:08 D.... 0 0 testDir/.git
2018-04-19 02:46:23 D.... 0 0 testDir/.git/branches
2018-04-19 02:46:23 D.... 0 0 testDir/.git/hooks
2018-04-19 02:46:23 D.... 0 0 testDir/.git/info
2018-04-19 02:47:08 D.... 0 0 testDir/.git/logs
2018-04-19 02:47:08 D.... 0 0 testDir/.git/logs/refs
2018-04-19 02:47:08 D.... 0 0 testDir/.git/logs/refs/heads
2018-04-19 02:47:08 D.... 0 0 testDir/.git/logs/refs/remotes
2018-04-19 02:47:08 D.... 0 0 testDir/.git/logs/refs/remotes/origin
2018-04-19 02:46:23 D.... 0 0 testDir/.git/objects
2018-04-19 02:46:23 D.... 0 0 testDir/.git/objects/info
2018-04-19 02:47:08 D.... 0 0 testDir/.git/objects/pack
2018-04-19 02:47:08 D.... 0 0 testDir/.git/refs
2018-04-19 02:47:08 D.... 0 0 testDir/.git/refs/heads
2018-04-19 02:47:08 D.... 0 0 testDir/.git/refs/remotes
2018-04-19 02:47:08 D.... 0 0 testDir/.git/refs/remotes/origin
2018-04-19 02:46:23 D.... 0 0 testDir/.git/refs/tags
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.3
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.3/taskArtifacts
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.3/tasks
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.4.1
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.4.1/file-changes
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.4.1/fileContent
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.4.1/javaCompile
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/3.4.1/taskHistory
2018-04-19 02:47:08 D.... 0 0 testDir/.gradle/buildOutputCleanup
2018-04-19 02:47:08 D.... 0 0 testDir/.idea
2018-04-19 02:47:08 D.... 0 0 testDir/.idea/copyright
2018-04-19 02:47:08 D.... 0 0 testDir/.idea/libraries
2018-04-19 02:47:08 D.... 0 0 testDir/.idea/markdown-navigator
2018-04-19 02:47:08 D.... 0 0 testDir/app
2018-04-19 02:47:08 D.... 0 0 testDir/app/src
p7zip 으로 압축한 test.7z 파일을 윈도우로 가져와서 풀면 당연히 잘 풀린다.
'Engineering > Linux' 카테고리의 다른 글
| putty 에서 깨진 한글 보기 (0) | 2019.04.12 |
|---|---|
| 네트워크 설정 on CentOS 6 (0) | 2018.09.20 |
| CentOS 6 text 모드에서 GUI 모드로 (0) | 2018.07.19 |
| ffmpeg install on CentOS (0) | 2017.10.19 |
| NodeJS 설치 on CentOS 7 (1) | 2017.09.12 |