Skip to content

Instantly share code, notes, and snippets.

@esperancaJS
Last active March 3, 2018 13:03
Show Gist options
  • Save esperancaJS/670123286a92134fb5944b76a0e1555a to your computer and use it in GitHub Desktop.
Save esperancaJS/670123286a92134fb5944b76a0e1555a to your computer and use it in GitHub Desktop.

install an google image crawler

pip install google_images_download

get some images

googleimagesdownload --keywords "Polar bears, baloons" --limit 100 --format jpg -a square

Rename all *.jpg files to [index].jpg

#!/bin/bash
counter=0
for file in *; do 
    [[ -f $file ]] && mv -i "$file" $((counter+1)).jpg && ((counter++))
done

move first 500 files

mv `ls | head -500` ./subfolder1/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment