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?

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

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


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.

  • There's garbage data: echo jj > a; rar a a.rar a; unrar p a.rar | gzip -9 -f > out.gz; zcat out.gz – daisy 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy