find . -name !('*.jpg') -print | while IFS=$'\n' read -r f; do mv "$f" "${f%}.jpg" done