Gentle Breeze

[Unix] tar/untar 본문

⑨ 직무역량강화/Unix | Linux

[Unix] tar/untar

재령 2012. 2. 15. 15:12
Unix 환경에서 tar 묶고 풀 일이 없다보니 가끔 쓸 때마다 옵션이 맨날 헛갈려서 가져옴.

- tar 풀기 (untar)

1) tar -xvf xxx.tar -C /home/directory/ 

2) tar -xvf /home/directory/ xxx.tar

** -C 는 디렉토리를 경로를 가리키며 -C 로 경로를 만들어 놓으면 그 경로에 xxx.tar 가 풀리게 됨 

- tar 묶기 (tar)

tar -cvf xxxx.tar yyyy
 
yyyy 라는 폴더를 xxxx.tar 로 묶는다는 것. (하위 디렉토리 포함)
 
- tar options
 
 -x, --extract, --get    아카이브에서 파일을 추출합니다
 -v, --verbose         verbosely list files processed
      --checkpoint      print directory names while reading the archive
      --check-links     print a message if not all links are dumped
      --totals          print total bytes written while creating archive
      --index-file=FILE send verbose output to FILE
      --utc             print file modification dates in UTC
 -f, --file=ARCHIVE             use archive file or device ARCHIVE
     --force-local              archive file is local even if has a colon
     --rmt-command=COMMAND      use given rmt COMMAND instead of /etc/rmt
     --rsh-command=COMMAND      use remote COMMAND instead of rsh


Comments