Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have some large files that I need to change the compression type of for input to a program--I need to unrar them and then gzip (or bzip2) them. However, they're highly compressed files and I don't have the disk space to unrar them fully then gzip them. Is there any way to pipe the output of decompression via unrar to gzip or some other compression without saving the entire intermediate result to disk?

share|improve this question

migrated from stackoverflow.com Oct 28 '12 at 23:02

This question came from our site for professional and enthusiast programmers.

1 Answer 1

man unrar mentions an option p: "Print file to stdout". So, it seems you might extract the file with unrar and pipe it to gzip/bzip2.

share|improve this answer
    
There's garbage data: echo jj > a; rar a a.rar a; unrar p a.rar | gzip -9 -f > out.gz; zcat out.gz –  warl0ck Oct 29 '12 at 0:07
    
@warl0ck Yes, add -ierr to suppress informational messages. Look at man unrar –  Olaf Dietsche Oct 29 '12 at 6:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.