Para listar todos os cortes das imagens:
cd .../wp-content/uploads
find . -regextype posix-extended -regex ".*-[0-9]{2,4}x[0-9]{2,4}.(jpg|jpeg|png|gif)" -type f

Para excluir todos os cortes das imagens:
cd .../wp-content/uploads
find . -regextype posix-extended -regex ".*-[0-9]{2,4}x[0-9]{2,4}.(jpg|jpeg|png|gif)" -type f -exec rm {}  \;

Para listar todos os cortes, exceto os padrões do wordpress:
find . -regextype posix-extended -regex ".*-[0-9]{2,4}x[0-9]{2,4}.(jpg|jpeg|png|gif)" -type f | egrep -vi '.*150x150.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*300x[0-9]{2,4}.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*[0-9]{2,4}x300.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*768x[0-9]{2,4}.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*[0-9]{2,4}x768.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*1024x[0-9]{2,4}.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*[0-9]{2,4}x1024.*\.(jpg|jpeg|png|gif)'

Para apagar todos os cortes, exceto os padrões do wordpress:
find . -regextype posix-extended -regex ".*-[0-9]{2,4}x[0-9]{2,4}.(jpg|jpeg|png|gif)" -type f | egrep -vi '.*150x150.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*300x[0-9]{2,4}.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*[0-9]{2,4}x300.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*768x[0-9]{2,4}.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*[0-9]{2,4}x768.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*1024x[0-9]{2,4}.*\.(jpg|jpeg|png|gif)' | egrep -vi '.*[0-9]{2,4}x1024.*\.(jpg|jpeg|png|gif)' | xargs rm -Rf

Deixe uma resposta