Question

For parallelizing gzip compression:

parallel gzip ::: myfile_*

does the job but how to pass gzip options such as -r or -9

I tried parallel gzip -r -9 ::: myfile_* and parallel gzip ::: 9 r myfile_*

but it doesn't work.

when I tried parallel "gzip -9 -r" ::: myfile_*

I get this error message :

gzip: compressed data not written to a terminal. Use -f to force compression

Also the -r switch for recursively adding directories is not working.

....

Similarly for other commands: how to pass the options while using parallel ?

Was it helpful?

Solution

You have the correct syntax:

parallel gzip -r -9 ::: myfile_*

So something else is wrong. What is the output of

parallel --version

You can find more about GNU Parallel at: http://www.gnu.org/s/parallel/

You can install GNU Parallel in just 10 seconds with:

wget -O - pi.dk/3 | sh 

Watch the intro video on

http://www.youtube.com/playlist?list=PL284C9FF2488BC6D1 

OTHER TIPS

(I don't think this question belongs here. Maybe superuser.com?)

parallel gzip -r -9 ::: * worked fine for me, going into directories and all. I am using parallel version 20130622.

Note that with this approach, each directory will be a single task. You may instead want to pipe the output of find to parallel to give each file separately to parallel.

Have you tried the --gnu flag for parallel??

parallel -j+0 --gnu "command"....

In some systems (like Ubuntu) is disabled by default.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top