tarファイルをgnu形式からpax形式に変換する方法

tarファイルをgnu形式からpax形式に変換する方法

一方では、次に生成されたtarファイルがたくさんあります。牛に似た栄養一方、私は次の形式のみをサポートするツールを持っています。公園(別名POSIX)フォーマット。既存のtarファイルをファイルシステムに抽出し、アーカイブを再生成せずにpax形式に変換する簡単な方法を探しています。

GNU tarは両方のフォーマットをサポートしています。しかし、私はそれを変換する簡単な方法を見つけることができませんでした。

既存の変換方法牛に似た栄養tarファイル公園

[私はsuperuser.comに同じ質問をし、コメント作成者はその質問をunix.stackexchange.comに移行することを提案しました。 ]

ベストアンサー1

以下を使用してこれを実行できます。bsdtar:

ire@localhost: bsdtar -cvf pax.tar --format=pax @gnu.tar
ire@localhost:file gnu.tar
gnu.tar: POSIX tar archive (GNU)
ire@localhost:file pax.tar
pax.tar: POSIX tar archive

@archiveそれは魔法の選択です。 ~からマンページ:

@archive
     (c and r mode only) The specified archive is opened and the
     entries in it will be appended to the current archive.  As a sim-
     ple example,
       tar -c -f - newfile @original.tar
     writes a new archive to standard output containing a file newfile
     and all of the entries from original.tar.  In contrast,
       tar -c -f - newfile original.tar
     creates a new archive with only two entries.  Similarly,
       tar -czf - --format pax @-
     reads an archive from standard input (whose format will be deter-
     mined automatically) and converts it into a gzip-compressed pax-
     format archive on stdout.  In this way, tar can be used to con-
     vert archives from one format to another.

おすすめ記事