
AIX 5.3 상자의 다른 디렉토리에 파일 압축을 풀려고 합니다.
tar -xvf -C /tmp/ ./MyFile.tar
tar: -C: No such file or directory
tar -C /tmp -xvf ./MyFile.tar
Usage: tar {c|r|t|u|x} [ bBdDEfFhilLXmNopRsSUvw[0-9] ]
tar -xvf ./MyFile.tar -C /tmp/
tar: file -C: not present in archive
tar: file /tmp/: not present in archive
메모:
GNU tar 설치는 옵션이 아닙니다
먼저 대상 디렉토리에 CD를 저장하지 않는 것이 좋습니다.
나는 보았다이 답변SU에서
감사해요
답변1
이 -C옵션은 아카이브를 생성할 때만 적용되며 복원할 때는 적용되지 않습니다. 유일한 옵션은 다음과 같이 먼저 복원할 디렉터리로 CD를 이동하는 것입니다.
( cd /tmp && tar -xvf /<pathToMyFile.tar>/MyFile.tar )
답변2
나는 같은 문제가 있었다타르, 그래서 나는팍스:
pax -rf <tarfile> -s/regexToInitialTargetDir/regexToFinalTargetDir/p
내 경우에는 이것이 목표였습니다./volume01/sotcha/그리고 나는/집/소차/그래서 정규식 부분은
-s/volume01/home/p