NOTICE

tar 묶기/풀기(?)

Date : 2007. 6. 26. 10:43 Category : Programming/Linux
[root@dddd ~~]ll
drwxr-xr-x 3 apache developer 4096 2월 6 11:19 birthday
drwxr-xr-x 3 apache developer 4096 2월 6 11:19 iframe
drwxr-xr-x 10 apache developer 4096 2월 24 2006 open_shop
drwxr-xr-x 8 apache developer 4096 2월 18 13:55 point

위와 같은 디렉토리 구조가 있다.
여기서 birthday라는 디렉토리를 tar로 묶으려면 아래와 같이 쓰면 된다.
tar cvzfp 파일명.tar.gz ./birthday



푸는 방법은
tar xvzfp 파일명.tar.gz



간혹 불필요한 디렉토리는 제외를 해야 하는 경우가 있다.
이럴 경우엔 --exclude를 쓰면 된다.
tar cvzfp 파일명.tar.gz ./birthday --exclude ./birthday/test



제외해야 할 디렉토리가 여러 개일 경우엔 그냥 띄어서 쓰면 된다.
tar cvzfp 파일명.tar.gz ./birthday --exclude ./birthday/test --exclude ./birthday/tttt