Skip to content

Instantly share code, notes, and snippets.

@AnmolTomer
Created July 9, 2020 20:35
Show Gist options
  • Save AnmolTomer/acbcfdb5501deaa24cac5be8269c79bb to your computer and use it in GitHub Desktop.
Save AnmolTomer/acbcfdb5501deaa24cac5be8269c79bb to your computer and use it in GitHub Desktop.
Takes download links from a txt file, makes a folder same as directory name, puts all the downloads in the dir and upon completion put all the files inside zip and save the structure with file size inside a tree.txt. Does this for all txt present in path.
for file in ./* ; do
dir=$(basename $file .txt)
mkdir $dir
cd $dir
wget -i "../${file}"
tree -h -D -o "${dir}_tree.txt" .
zip -r "${dir}.zip" .
rm *.pdf
cd ..
dir=""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment