압축

이전것/LINUX 2016. 3. 21. 20:23

root@KMU-UBUNTU:/work/fruit# ls
apple  banana  lemon  strow

: 4개를 하나의 파일로 묶음

 

$ tar

-c : 묶는다

-x : 푼다

-v : 과정을 보여준다

-t : 내용을 보여준다

-f : 파일 이름을 지정한다.

 

 

root@KMU-UBUNTU:/work# tar -cvf fruit.tar ./fruit/ : 압축하기
./fruit/
./fruit/lemon
./fruit/banana
./fruit/strow
./fruit/apple
root@KMU-UBUNTU:/work# ls
example    hlink                    slink       target.txt
fruit      korea                    slinks      test
fruit.tar  minicom_2.5-2_amd64.deb  source.txt

 

root@KMU-UBUNTU:/work# tar -xvf fruit.tar : 압축 풀기
./fruit/
./fruit/lemon
./fruit/banana
./fruit/strow
./fruit/apple
root@KMU-UBUNTU:/work# ls
example    hlink                    slink       target.txt
fruit      korea                    slinks      test
fruit.tar  minicom_2.5-2_amd64.deb  source.txt

gzip : 그놈 집

bzip : 초창기에 만들어 졌다가 업그레이트되서 bzip2로 사용하여야함

 

root@KMU-UBUNTU:/work# gzip fruit.tar : 압축하기
root@KMU-UBUNTU:/work# ls
example       hlink                    slink       target.txt
fruit         korea                    slinks      test
fruit.tar.gz  minicom_2.5-2_amd64.deb  source.txt

 

 

root@KMU-UBUNTU:/work# gunzip fruit.tar.gz  : 압축풀기
root@KMU-UBUNTU:/work# ls
example    hlink                    slink       target.txt
fruit      korea                    slinks      test
fruit.tar  minicom_2.5-2_amd64.deb  source.txt

 

root@KMU-UBUNTU:/work# bzip2 fruit.tar : 압축하기
root@KMU-UBUNTU:/work# ls
example        hlink                    slink       target.txt
fruit          korea                    slinks      test
fruit.tar.bz2  minicom_2.5-2_amd64.deb  source.txt


root@KMU-UBUNTU:/work# bunzip2 fruit.tar.bz2  : 압축풀기
root@KMU-UBUNTU:/work# ls
example    hlink                    slink       target.txt
fruit      korea                    slinks      test
fruit.tar  minicom_2.5-2_amd64.deb  source.txt

 

-d : 압축해제


tar -z

 

root@KMU-UBUNTU:/work# tar -cvzf fruit.tar.gz ./fruit/
./fruit/
./fruit/lemon
./fruit/banana
./fruit/strow
./fruit/apple
root@KMU-UBUNTU:/work# ls
example       hlink                    slink       target.txt
fruit         korea                    slinks      test
fruit.tar.gz  minicom_2.5-2_amd64.deb  source.txt
root@KMU-UBUNTU:/work# tar -xvzf fruit.tar.gz
./fruit/
./fruit/lemon
./fruit/banana
./fruit/strow
./fruit/apple
root@KMU-UBUNTU:/work# ls
example       hlink                    slink       target.txt
fruit         korea                    slinks      test
fruit.tar.gz  minicom_2.5-2_amd64.deb  source.txt

------------------------------------------------------

 

root@KMU-UBUNTU:/work# tar -cvjf fruit.tar.bz2 ./fruit/
./fruit/
./fruit/lemon
./fruit/banana
./fruit/strow
./fruit/apple
root@KMU-UBUNTU:/work# ls
example hlink slink target.txt
fruit korea slinks test
fruit.tar.gz minicom_2.5-2_amd64.deb source.txt
root@KMU-UBUNTU:/work# tar -xvjf fruit.tar.bz2
./fruit/
./fruit/lemon
./fruit/banana
./fruit/strow
./fruit/apple
root@KMU-UBUNTU:/work# ls
example hlink slink target.txt
fruit korea slinks test
fruit.tar.gz minicom_2.5-2_amd64.deb source.txt

 

 

'이전것 > LINUX' 카테고리의 다른 글

device driver  (0) 2016.05.09
make  (0) 2016.04.04
퍼미션  (0) 2016.03.21
링크파일  (0) 2016.03.21
ls  (0) 2016.03.21
블로그 이미지

잉비니

,