"리눅스 tar 특정폴더 제외하고 압축하기"의 두 판 사이의 차이

 
(다른 사용자 한 명의 중간 판 9개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;리눅스 폴더 압축, 특정폴더 제외
;리눅스 폴더 압축, 특정폴더 제외
;리눅스 폴더 압축, 특정파일 제외
;리눅스 폴더 압축, 특정파일 제외
;tar 압축시 특정 디렉토리 제외하고 압축하기
;리눅스 tar 특정폴더 제외하고 압축하기
;리눅스 tar 압축시 특정 디렉토리 제외하고 압축하기
;tar --exclude 옵션


<source lang='bash'>
<source lang='bash'>
tar cvzf 파일명.tgz 폴더 --exclude 제외할것
tar cvzf 파일명.tgz 폴더 --exclude 제외할것
</source>
</source>
* 제외할것에 폴더를 기입하면 폴더가 제외되고, 파일을 기입하면 파일이 제외됨
:→ 제외할것에 폴더를 기입하면 폴더가 제외되고, 파일을 기입하면 파일이 제외됨
<source lang='bash'>
tar cvzf 파일명.tgz 폴더 --exclude 제외할것하나 --exclude 제외할것둘
</source>
:→ 여러가지를 제외하려면 --exclude를 계속 추가


==예시==
==예시==
<source lang='console'>
<source lang='console'>
root@zetawiki:~# tree test
root@zetawiki:~# tar cvzf test.tgz test/
test
test/
├── aaa
test/bbb/
│   └── hello.txt
test/bbb/world.txt
└── bbb
test/aaa/
    └── world.txt
test/aaa/hello.txt
 
2 directories, 2 files
</source>
</source>
<source lang='console'>
<source lang='console'>
44번째 줄: 48번째 줄:


[[분류: 리눅스]]
[[분류: 리눅스]]
[[분류: tar]]

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 }}