라즈비안에서 '7z 파일' 압축을 풀고 싶을 때가 있다.
p7zip 유틸리티를 설치
먼저 p7zip 유틸리티를 설치하자.
$ apt install p7zip
root@raspberrypi:/home/pi/work/crash_dump/out# apt install p7zip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
python-colorzero
Use 'sudo apt autoremove' to remove it.
Suggested packages:
p7zip-full
The following NEW packages will be installed:
p7zip
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 350 kB of archives.
After this operation, 1,006 kB of additional disk space will be used.
Fetched 350 kB in 0s (1,070 kB/s)
Selecting previously unselected package p7zip.
(Reading database ... 92716 files and directories currently installed.)
Preparing to unpack .../p7zip_16.02+dfsg-6_arm64.deb ...
Unpacking p7zip (16.02+dfsg-6) ...
Setting up p7zip (16.02+dfsg-6) ...
Processing triggers for man-db (2.8.5-2) ...
설치 완료!
p7zip는 어디에 있나?
root@raspberrypi:/home/pi/work/crash_dump/rpi_sample# whereis p7zip
p7zip: /usr/bin/p7zip /usr/lib/p7zip /usr/share/man/man1/p7zip.1.gz
root@raspberrypi:/home/pi/work/crash_dump/rpi_sample# p7zip
/usr/bin/p7zip: compressed data not written to a terminal.
For help, type: /usr/bin/p7zip -h
'/usr/bin/p7zip' 디렉토리에 존재한다.
p7zip help 출력 결과
root@raspberrypi:/home/pi/work/crash_dump/rpi_sample# /usr/bin/p7zip -h
Usage: /usr/bin/p7zip [options] [--] [ name ... ]
Options:
-c --stdout --to-stdout output data to stdout
-d --decompress --uncompress decompress file
-f --force do not ask questions
-k --keep keep original file
-h --help print this help
-- treat subsequent arguments as file
names, even if they start with a dash
이제 압축을 풀어볼까?
$ p7zip -d file.7z
root@raspberrypi:/home/pi/work/crash_dump/rpi_sample# p7zip -d user_call_stack_dump_rpi.7z
7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_GB.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs LE)
Scanning the drive for archives:
1 file, 110218549 bytes (106 MiB)
Extracting archive: user_call_stack_dump_rpi.7z
--
Path = user_call_stack_dump_rpi.7z
Type = 7z
Physical Size = 110218549
Headers Size = 918
Method = LZMA2:24
Solid = +
Blocks = 5