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?

link|improve this question

71% accept rate
feedback

2 Answers

up vote 4 down vote accepted

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

link|improve this answer
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 – usajbalt Jan 12 '11 at 15:53
feedback

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/
link|improve this answer
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?? – usajbalt 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
feedback

Your Answer

 
or
required, but never shown

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