Skip to content

Instantly share code, notes, and snippets.

@metric-space
Created April 24, 2020 22:52
Show Gist options
  • Save metric-space/1b053f9d1200c29f4cf32ad66c92332b to your computer and use it in GitHub Desktop.
Save metric-space/1b053f9d1200c29f4cf32ad66c92332b to your computer and use it in GitHub Desktop.
personal bash script to move pdfs of a certain page count to a folder
ls | grep -i .pdf | while read -r line ; do
egg=$(pdfinfo "$line" | grep Pages | sed 's/[^0-9]*//')
if [ $egg -gt 20 ]; then
echo "Processing $line with $egg"
mv "$line" BOOKS
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment