RadarURL

조회 수 685 추천 수 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
번호 분류 제목 글쓴이 날짜 조회 수
공지 [공지] 공부 게시판 입니다. 처누 2003.08.18 927565
2286 육아,교육 “엄마한테 맡겨” 이제 그만, “세뱃돈 어떻게 쓸까” 함께 토론…돈 모을 목표 만들어 주세요 file JaeSoo 2016.02.11 730
2285 유닉스/리눅스 Subversion 팁: 특정 날짜의 소스 코드 받아오기 JaeSoo 2016.02.11 671
2284 윈도우즈 Windows Update 웹 사이트에서 Microsoft Update 웹 사이트에서 또는 백그라운드 인텔리전트 전송(BIT) 서비스 시작하려고 하면 업데이트를 다운로드하려고 하면 오류 메시지가 나타난다 1 JaeSoo 2016.02.11 2920
2283 취업 정보시스템 감리 회사 근무 JaeSoo 2016.02.11 798
2282 응용 프로그래밍 [SVN] Subversion 명령들 file JaeSoo 2016.02.06 966
» 유닉스/리눅스 AIX - tar,gzip 명령어 (한번에 압축하기) - Linux참고 JaeSoo 2016.02.02 685
2280 업무 조달청에 조달요청할 수 있는 수요기관의 범위는? - 조달청 수요기관 고시세부내역 JaeSoo 2016.02.01 634
2279 유닉스/리눅스 AIX에서 논리적 볼륨 크기 확장 JaeSoo 2016.01.28 560
2278 업무 정보화전략 계획 감리 file JaeSoo 2016.01.27 561
2277 응용 프로그래밍 IBM JDK 1.6 에서 Spring 2.5.2를 사용할 때 GenericTypeResolver 에서 NullPointerException이 발생하는 문제 JaeSoo 2016.01.27 785
2276 생활 영어이름 뜻과 기원 JaeSoo 2016.01.23 876
2275 업무 국내 컨설팅 주요기업 현황 file JaeSoo 2016.01.23 532
2274 유닉스/리눅스 [AIX] Filesystem 사이즈 조절하기 JaeSoo 2016.01.23 433
2273 윈도우즈 일부 업데이트가 설치되지 않았습니다 오류 해결 JaeSoo 2016.01.23 854
2272 취업 프리랜서 면접시 이런식으로 말하면 조심하세요. JaeSoo 2016.01.22 15594
2271 웹 프로그래밍 오른쪽 마우스 금지 소스 / 드래그 금지 소스 JaeSoo 2016.01.20 475
2270 사무 소프트웨어 엑셀 최대값(max),최소값(min) if함수로 조건 일치값 구하기 file JaeSoo 2016.01.14 881
2269 웹서버,WAS [JAVA] 개발환경설정 - 표준프레임워크 file JaeSoo 2016.01.02 791
2268 웹서버,WAS Tomcat 7.x 와 8.x 간의 default configuration 차이 JaeSoo 2016.01.02 716
2267 응용 프로그래밍 [전자정부 표준프레임워크] 톰캣(Tomcat) 설치하기 file JaeSoo 2016.01.02 533
Board Pagination Prev 1 ... 5 6 7 8 9 10 11 12 13 14 ... 124 Next
/ 124


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너