Skip to content

Instantly share code, notes, and snippets.

@phcostabh
Last active July 12, 2017 18:04
Show Gist options
  • Select an option

  • Save phcostabh/1597f74124e041edfbe26ee786bf5d93 to your computer and use it in GitHub Desktop.

Select an option

Save phcostabh/1597f74124e041edfbe26ee786bf5d93 to your computer and use it in GitHub Desktop.
Convert gzipped files to zip using named pipes and parallelism (with xargs)
find *.gz | xargs -n 1 -P 4 -I{} bash -c 'f={}; mkfifo ${f%*.gz}; zip -9 -v -FI ${f%*.gz}.zip ${f%*.gz} & gunzip -cd $f > ${f%*.gz} && rm ${f%*.gz}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment