tar 명령을 이용하여 파일을 압축할 때 exclude 옵션을 이용하여
특정 파일을 제외할 수 있다.
<지정한 디렉토리를 file.tar.gz 으로 압축하고, .log, .attatch 로 끝나는 파일, folder_name 디렉토리 제외>
tar -zcvf file.tar.gz source_dir_name --exclude="*.log" --exclude="*.attach*" --exclude="./folder_name"
반응형
'리눅스 > Bash' 카테고리의 다른 글
[bash][split] 파일을 라인단위로 나누기 위한 split 명령어 (0) | 2017.08.01 |
---|---|
[command] tree 커맨드 (0) | 2017.07.25 |
[ls] ls 명령어의 --time-style 옵션 이용하기 (0) | 2017.06.27 |
[bash][grep] grep 명령어 사용방법 (0) | 2017.05.24 |
[bash] 쉘 스크립트에서 문자열에 특정 문자가 존재하는지 확인하여 처리 (0) | 2017.05.23 |