[Linux] tar 명령어 - 압축/해제 방법

ASHAPPYASIKNOW·2022년 7월 22일
0

OS(Linux, Mac, Windows)

목록 보기
1/9
post-thumbnail

Linux 에서 tar 명령어를 이용하여 tar.gz 파일 만들기

tar 명령어로 압축하기

tar -czvf server_log.tar.gz ./logs

현재 폴더에 tar.gz 파일을 생성 함

tar 명령어로 압축 해제하기

tar -xzvf server_log.tar.gz .

현재 폴더에 tar.gz 파일을 해제 시킴

설명

  • c: archive 파일 만들기
  • x: archive 파일 해제하기
  • z: archive 파일을 압축하거나 해제 함
  • v: 압축이나 해제 과정을 글로 알려 줌
  • f: archive 파일 이름
  • c: (--create) create a new archive
  • x: (--extract, --get) extract files from an archive
  • z: (--gzip, --gunzip, --ungzip) filter the archive through gzip
  • v: (--verbose) verbosely list files processed
  • f: (-file=ARCHIVE) use archive file or device ARCHIVE

REFERENCES

Linux tar Command – How to Compress Files in Linux

profile
36.9 It's good time to start something new

0개의 댓글