Skip to content

Instantly share code, notes, and snippets.

@Alexhha
Created February 4, 2018 14:51
Show Gist options
  • Save Alexhha/a3195451d50cab8720f19ee2416d6a1d to your computer and use it in GitHub Desktop.
Save Alexhha/a3195451d50cab8720f19ee2416d6a1d to your computer and use it in GitHub Desktop.
#!/bin/bash
PATH_PREFIX=/opt/upload/10k
zipinfo -1 100k.zip | grep -v /$ | head -10000 | while read curr_file
do
curr_dir=$(dirname ${curr_file})
if [[ ! -d ${PATH_PREFIX}/${curr_dir} ]]; then
mkdir -p ${PATH_PREFIX}/${curr_dir}
fi
unzip -j 100k.zip "${curr_file}" -d "${PATH_PREFIX}/${curr_dir}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment