-Cを使用したtarは機能しません。

-Cを使用したtarは機能しません。

tarこの方法を使用して別のディレクトリに入ろうとします。

tar xvf BACKUP.tar -C test

しかし、次のエラーが発生します

File -C not present in the archive.
File test not present in the archive.

使用

tar xv -C test -f BACKUP.tar

次のエラーが発生します。

tar: /dev/rmt0: A file or directory in the path name does not exist.

tar コマンドを実行する pwd にテスト ディレクトリとファイル BACKUP.tar があります。

それでも同じエラーが発生します。

tar -xvf BACKUP.tar -C test
File -C not present in the archive.
File test not present in the archive.

そして

tar --version

このエラーが発生します

tar: Not a recognized flag: -
Usage: tar -{c|r|t|u|x} [ -BdDEFhilmopRUsvwZ ] [ -Number ] [ -f TarFil e ]
           [ -b Blocks ] [ -S [ Feet ] | [ Feet@Density ] | [ Blocksb ] ]
           [ -L InputList ] [-X ExcludeFile] [ -N Blocks ] [ -C Directory ] File ...
Usage: tar {c|r|t|u|x} [ bBdDEfFhilLXmNopRsSUvwZ[0-9] ] ]
           [ Blocks ] [ TarFile ] [ InputList ] [ ExcludeFile ]
           [ [ Feet ] | [ Feet@Density ] | [ Blocksb ] ] [-C Directory ] File ...

ベストアンサー1

xvf私は、マイナス記号()を持たない古いスタイルオプションとマイナス記号()を持つ新しいスタイルオプションの混合を許可しないAIXを使用していると思います-C

すべてのオプションの前にマイナス記号を入れると正常に動作します。

tar -xvf BACKUP.tar -C test

それでも問題が解決しない場合は、ヘルプメッセージに従って各オプションを個別に入力することもできます。

tar -x -v -f BACKUP.tar -C test

また見なさい:https://unix.stackexchange.com/a/97360/3169

おすすめ記事