tar.bz2を.bz2に変換するには? [閉鎖]

tar.bz2を.bz2に変換するには? [閉鎖]

圧縮ファイルtar.bz2があり、これを.bz2に変換したいと思います。一度に行う命令がありますか?

私は以下を試しましたが、喜びはありません!

 tar -xvjf US.tar.bz2
 US

 bzip2: Compressed file ends unexpectedly;
         perhaps it is corrupted?  *Possible* reason follows.
 bzip2: Inappropriate ioctl for device
         Input file = (stdin), output file = (stdout)

 It is possible that the compressed file(s) have become corrupted.
 You can use the -tvv option to test integrity of such files.

 You can use the `bzip2recover' program to attempt to recover
 data from undamaged sections of corrupted files.

 tar: Unexpected EOF in archive
 tar: Unexpected EOF in archive

ポリスチレン

また、以下を試しました。

Bunzip2 -c < US.tar.bz2 圧縮パッケージ gzip -c > us.bz2

生産する:

bunzip2: Compressed file ends unexpectedly;
    perhaps it is corrupted?  *Possible* reason follows.
bunzip2: Inappropriate ioctl for device
    Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

ベストアンサー1

tarzipファイルと同様に、いくつかの異なるファイルを保存しますが、圧縮しません。 bzip2ファイルを圧縮しますが、一度に1つのファイルのみを圧縮します。ファイルは、挿入後に圧縮された.tar.bz2ファイルの束を表すことができます。tarまず、ターリングせずに一緒に圧縮することはできません。

あなたのエラーは、ファイルが.tar.bz2破損しているために発生します。作業ファイルの例については、以下を参照してください。

$ ls
test_file.tar.bz2
$ tar xvjf test_file.tar.bz2 
test_file
$ ls
test_file  test_file.tar.bz2

編集する


上記の例では、tar.gzにファイルが1つしかありません。フォルダのみを圧縮したい場合:

$ bzip2 test_file
$ ls
test_file.bz2

おすすめ記事