Skip to content

Instantly share code, notes, and snippets.

@vepetkov
Created March 7, 2019 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vepetkov/5f8332940d6c01c525c55ae7e840fe8c to your computer and use it in GitHub Desktop.
Save vepetkov/5f8332940d6c01c525c55ae7e840fe8c to your computer and use it in GitHub Desktop.
# Unzip in-place (i.e. in the folder containing the file and not the current one)
find . -type f -name "*.zip" | xargs -P4 -I fileName sh -c 'unzip -o -d "$(dirname "fileName")" "fileName" && rm "fileName"'
# Gzip all CSV extracted from the ZIP files
find . -type f -name *.csv -print0 | xargs -0 -n1 -P4 gzip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment