Unix & Linux
tar 상대경로로 폴더째압축하기
아로나
2013. 1. 17. 16:11
tar로 폴더 압축 시 절대경로가 아닌 상대경로로 압축하고 싶다면???
1. tar cvf 파일명.tar ./xxx/xxx/test.class (윈도우)
tar -cvf 파일명.tar ./xxx/xxx/test.class (유닉스)
ex) 현재경로 : /test1/abc/234 에 파일 a.class 와 b.class가 있다고 가정할때
b.class를 abc/234라는 상대결로로만 tar로 묶고 싶다면??
=> cd /test
tar cvf test1.tar ./abc/234/b.class (압축)
원하는 경로로 이동(예를 들면 /test999)
cd /test999
tar xvf test1.tar (압축해제)
----> /test999/abc/234/b.class 파일이 생성된다.
첨부파일 : 윈도우용 tar 파일