"리눅스 gzip"의 두 판 사이의 차이

2번째 줄: 2번째 줄:
;리눅스 gzip
;리눅스 gzip
;/bin/gzip
;/bin/gzip
* 간편한 압축 도구
* 옵션을 주지 않으면 실행하면 압축 후 원본을 삭제한다는 점에 유의하자.


{| class='wikitable'
{| class='wikitable'

2019년 6월 23일 (일) 20:53 판

1 개요

리눅스 gzip
/bin/gzip
  • 간편한 압축 도구
  • 옵션을 주지 않으면 실행하면 압축 후 원본을 삭제한다는 점에 유의하자.
옵션 설명
-d, --decompress 압축해제
-k, --keep 원본파일 보존 (삭제 안함) ★
-l, --list 압축파일 내용물 확인

2 실습1: 기본

testuser@localhost:~$ fallocate -l 1MB test.txt
testuser@localhost:~$ ll test.txt
-rw-rw-r-- 1 testuser testuser 1000000 Jun 23 20:45 test.txt
testuser@localhost:~$ gzip test.txt 
testuser@localhost:~$ ll test.*
-rw-rw-r-- 1 testuser testuser 1012 Jun 23 20:45 test.txt.gz
→ test.txt 파일이 text.txt.gz로 압축되고 원본은 삭제되었다.

3 실습2: 옵션 -k

testuser@localhost:~$ fallocate -l 1MB test.txt
testuser@localhost:~$ ll test.txt
-rw-rw-r-- 1 testuser testuser 1000000 Jun 23 20:48 test.txt
testuser@localhost:~$ gzip -k test.txt 
testuser@localhost:~$ ll test.*
-rw-rw-r-- 1 testuser testuser 1000000 Jun 23 20:48 test.txt
-rw-rw-r-- 1 testuser testuser    1012 Jun 23 20:48 test.txt.gz
→ test.txt 파일이 text.txt.gz로 압축되고 원본은 그대로 있다.

4 실습3: 옵션 -l

testuser@localhost:~$ gzip -l test.txt.gz 
         compressed        uncompressed  ratio uncompressed_name
               1012             1000000  99.9% test.txt

5 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}