Created
May 15, 2017 17:35
-
-
Save minademian/56fad650e759a14e0bfff9a6f988bc5a to your computer and use it in GitHub Desktop.
batch move downloaded PDFs to new dir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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