Skip to content

Instantly share code, notes, and snippets.

@ermolaev
Last active August 29, 2015 14:16
Show Gist options
  • Save ermolaev/fc3b8b4d77ba103ae57e to your computer and use it in GitHub Desktop.
Save ermolaev/fc3b8b4d77ba103ae57e to your computer and use it in GitHub Desktop.
bash scripts
# jpeg - > jpg
find -name '*.jpeg' -exec rename 's/\.jpeg/\.jpg/' '{}' \;
# удаляем
find public/files/comments/ -type f -name '*.bmp' -delete
th2umb -> thumb
find -type f -name '*thumb*' -delete
find -name '*th2umb*' -exec rename 's/th2umb/thumb/' '{}' \;
rename - очень медленная поэтому лучше (но не быстрее) в цикле делать удаление и переименование
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment