Reputation: 18885
I have lots of bunzip2 compressed files that I would like to convert to .gz. I tried the following using a pipe, but it does not work. I guess the reason is gzip does not know what files to zip.
bunzip2 test.txt.bz2 | gzip
any way to use a pipe for connecting bunzip2
and gzip
?
Upvotes: 1
Views: 1489
Reputation: 181
When running gzip with no parameters, it expects its output to be piped into a file:
bzcat test.txt.bz2 | gzip -c - >test.txt.gz
For completeness, I have included the following (although they are both optional when input is from standard input and output is redirected or sent to another pipe):
Upvotes: 4