Last active
March 18, 2020 17:28
-
-
Save mzfshark/fa8f74f87ffb319e79a2813f3f6e4b8e to your computer and use it in GitHub Desktop.
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 | |
if [[ -z $1 ]]; then | |
echo "Informe um caminho... Ex: resize /home/user_url" | |
else | |
# Renomeando todos os arquivos [JPG jpeg gif png] para jpg | |
find $1 -type f \( -name \*.JPG -o -iname \*.jpeg -o -iname \*.gif -o -iname \*.png \) | xargs -n 1 bash -c 'mv "$0" "${0%.*}.jpg"' | |
# Convertendo todas as imagens para 600 px | |
find $1 -type f -name \*.jpg | xargs -L1 -I{} convert -resize 600 "{}" "{}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment