리눅스 tar 특정폴더 제외하고 압축하기

1.215.138.86 (토론)님의 2017년 8월 4일 (금) 09:51 판 (→‎개요)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

리눅스 폴더 압축, 특정폴더 제외
리눅스 폴더 압축, 특정파일 제외
리눅스 tar 특정폴더 제외하고 압축하기
리눅스 tar 압축시 특정 디렉토리 제외하고 압축하기
tar --exclude 옵션
tar cvzf 파일명.tgz 폴더 --exclude 제외할것
→ 제외할것에 폴더를 기입하면 폴더가 제외되고, 파일을 기입하면 파일이 제외됨
tar cvzf 파일명.tgz 폴더 --exclude 제외할것하나 --exclude 제외할것둘
→ 여러가지를 제외하려면 --exclude를 계속 추가

2 예시[ | ]

root@zetawiki:~# tar cvzf test.tgz test/
test/
test/bbb/
test/bbb/world.txt
test/aaa/
test/aaa/hello.txt
root@zetawiki:~# tar cvzf test.tgz test/ --exclude test/bbb
test/
test/aaa/
test/aaa/hello.txt
root@zetawiki:~# tar cvzf test.tgz test/ --exclude test/bbb/world.txt 
test/
test/bbb/
test/aaa/
test/aaa/hello.txt
root@zetawiki:~# tar cvzf test.tgz test/ --exclude test/aaa/hello.txt --exclude test/bbb/world.txt 
test/
test/bbb/
test/aaa/

3 같이 보기[ | ]

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