RadarURL
Skip to content
조회 수 615 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

LINUX에서는 함께 쓰는 명령이 될지 모르겠습니다.

아니 오히려 아래 방법보다 좋은 옵션이 있습니다.

 

tar 명령어 중에 옵션에 -z 옵션을 추가하면 gzip 까지 압축이 되고 풀리게 됩니다.

*압축풀기

ex) tar -xvzf [파일명]                       

*압축하기

ex) tar -cvzf [파일명].tar.gz [파일대상]

 

 

*압축

 
tar -cvf - ${소스파일} | gzip > ${압축될 파일이름}
 
test:/home/st/GC/test# tar -cvf - native_stderr.log | gzip > native_stderr.log.tar.gz
a native_stderr.log 14616 blocks
test:/home/st/GC/test# ls -arlt
total 30704
-rw-r--r--    1 st   staff       7482898 Sep 24 16:10 native_stderr.log
-rw-r--r--    1 root     system      7487488 Feb  4 10:02 native_stderr.log.tar
drwxr-xr-x    3 st   staff           256 Feb  4 10:02 ..
drwxr-xr-x    2 root     system          256 Feb  4 10:06 .
-rw-r--r--    1 root     system       742651 Feb  4 10:06 native_stderr.log.tar.gz
 
*풀기 1
 
test:/home/st/GC/test# gzip -d native_stderr.log.tar.gz
test:/home/st/GC/test# tar -xvf native_stderr.log.tar 
x native_stderr.log, 7482898 bytes, 14616 tape blocks
 
*풀기 2
test:/home/st/GC/test# gzip -dc native_stderr.log.tar.gz | tar -xvf -
x native_stderr.log, 7482898 bytes, 14616 tape blocks
test:/home/st/GC/test# ls -arlt
total 16072
drwxr-xr-x    3 st staff           256 Feb  4 10:02 ..
-rw-r--r--    1 root     system      7482898 Feb  4 10:18 native_stderr.log
-rw-r--r--    1 root     system       742667 Feb  4 10:19 native_stderr.log.tar.gz
drwxr-xr-x    2 root     system          256 Feb  4 10:25 .
 
 
*결과확인 (같다)
drwxr-xr-x    3 st   staff           256 Feb  4 10:02 ..
-rw-r--r--    1 root     system      7482898 Feb  4 10:18 native_stderr.log
-rw-r--r--    1 root     system      7487488 Feb  4 10:19 native_stderr.log.tar
drwxr-xr-x    2 root     system          256 Feb  4 10:21 .
test:/home/st/GC/test# tail -20f native_stderr.log
  <tenured freebytes="274968" totalbytes="268435456" percent="0" >
    <soa freebytes="0" totalbytes="265751552" percent="0" />
    <loa freebytes="274968" totalbytes="2683904" percent="10" />
  </tenured>
  <gc type="global" id="909" totalid="909" intervalms="63995.071">
    <refs_cleared soft="0" threshold="32" weak="3704" phantom="2" />
    <finalization objectsqueued="3706" />
    <timesms mark="70.329" sweep="2.838" compact="0.000" total="73.302" />
    <tenured freebytes="225637120" totalbytes="268435456" percent="84" >
      <soa freebytes="222985704" totalbytes="265751552" percent="83" />
      <loa freebytes="2651416" totalbytes="2683904" percent="98" />
    </tenured>
  </gc>
  <tenured freebytes="225635912" totalbytes="268435456" percent="84" >
    <soa freebytes="222984496" totalbytes="265751552" percent="83" />
    <loa freebytes="2651416" totalbytes="2683904" percent="98" />
  </tenured>
  <time totalms="73.886" />
</af>
 

 

 

출처 : http://soul0.tistory.com/244

?

List of Articles
번호 제목 글쓴이 날짜 조회 수
142 [Linux/Unix] 심볼릭 링크(ln) 만들기 및 확인/삭제 JAESOO 2016.02.19 639
» AIX - tar,gzip 명령어 (한번에 압축하기) - Linux참고 JAESOO 2016.02.02 615
140 AIX에서 논리적 볼륨 크기 확장 JAESOO 2016.01.28 510
139 [AIX] Filesystem 사이즈 조절하기 JAESOO 2016.01.23 510
138 cpulimit - cpu 사용량을 정한다. JAESOO 2015.08.24 554
137 좀비 프로세스 찾기, 죽이기 JAESOO 2015.05.27 879
136 SetUid와 SetGid JAESOO 2015.05.27 545
135 특별한 퍼미션 setuid setgid sticky bit JAESOO 2015.05.27 533
134 SETUID, SETGID, Sticky Bit JAESOO 2015.05.27 952
133 Tomcat 무분별하게 catalina.out 크기 커지는것 막기 JAESOO 2015.04.13 3129
132 톰캣(Tomcat) 실시간 로그보기 JAESOO 2015.04.13 1043
131 ls - 파일리스팅 (접근, 수정, 속성변경 시간별 정렬 등) JAESOO 2015.02.24 749
130 리눅스(Linux)에서 하위 디렉토리까지 파일 찾기, 찾아서 지우기 JAESOO 2015.02.24 1199
129 아파치서버 동시접속자수에 따른 메모리 산정 (대략) JAESOO 2015.01.13 1588
128 데비안 리눅스 로그 관리 JAESOO 2015.01.13 668
127 리눅스 로그파일관리 (logrotate) JAESOO 2015.01.13 703
126 리눅스 logrotate를 활용한 로그 관리 (compress, lotate) JAESOO 2015.01.13 1138
125 CentOS5 MRTG서버 트래픽 모니터링 JAESOO 2014.12.26 912
124 SNMP 를 설정해 보자 (CentOS 5.6) JAESOO 2014.12.26 1252
123 [CentOS] MRTG를 설치하여 서버의 대역폭을 기록하자 JAESOO 2014.12.26 801
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9

PageViews   Today : 3167 Yesterday : 2394 Total : 21716825  /  Counter Status   Today : 766 Yesterday : 1232 Total : 1142908

Edited by JAESOO

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소