Skip to content

Instantly share code, notes, and snippets.

@minademian
Created May 15, 2017 17:35
Show Gist options
  • Save minademian/56fad650e759a14e0bfff9a6f988bc5a to your computer and use it in GitHub Desktop.
Save minademian/56fad650e759a14e0bfff9a6f988bc5a to your computer and use it in GitHub Desktop.
batch move downloaded PDFs to new dir
#!/bin/bash
srcDir="/foo/bar" # <--- change this to where you will download the files
newDir="/foo/bar/ouch" # <--- change this to where you want to move the files
url="your url"
echo "Let's download some files..."
wget -m -P $srcDir -A pdf $url
echo "going to $srcDir..."
cd $srcDir
echo "creating destination directory called $newDir"
mkdir -p $newDir
find $srcDir -name "*.pdf" -exec mv -t $newDir {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment