I made a bzip2 file by

bzip2 -c /home/os/picture1 > /home/os/Desktop/pic.image

bzip2 -c /home/os/picture2 >> /home/os/Desktop/pic.image

But now extracting pic.image by bzip2 -d /home/os/Desktop/pic.image returns

bzip2: Can't guess original name for pic.image -- using pic.image.out

and then it just creates one file pic.image.out.

How do I access picture1 and picture2 from pic.image?

up vote 4 down vote accepted

bzip2 is compression only. If you want file packing then you need to use tar as well.

  • And from the documentation: If the file does not end in one of the recognised endings, .bz2, .bz, .tbz2 or .tbz, bzip2 complains that it cannot guess the name of the original file, and uses the original name with .out appended. – Arjan Dec 13 '10 at 14:02
  • so...now...there is no hack to access picture1 or picture2 from pic.image?? :-o – Undefined Jan 12 '11 at 15:53

You should use tar instead :

tar cjf /path/to/pics.tar.bz2 /path/pic1 /path/pic2
tar xjf /path/to/pics.tar.bz2 -C /path/to/extract/
  • Okay got you. BUT my file's extension is not .tar.bz2. It's just .image. What do you suggest to get my picture1 and picture2 from pic.image? Got any hack in mind?? – Undefined Jan 12 '11 at 15:54
  • hmm, all i can think of is writing a script that reads the file and extracts based on the bzip2 header, however there's no way of restoring the original file names that way. – OneOfOne Jan 12 '11 at 19:48

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.