How I can rename images with 'rename' command from "something_full.jpg" to "something_500.jpg" recursive?
Answer
Basically, you can use the rename
tool for that. It should come in a Perl-based version with Debian-based Linux distros, but you can easily download it from source as well (obviously, you need to make it executable first with chmod +x
).
The following command will replace the _full
part with _500
on all JPG files in the current directory.
rename 's/_full/_500/' *.jpg
To do this recursively, starting from your current directory, use rename
with find
.
find . -type f -iname "*.jpg" -exec rename 's/_full/_500/' {} \;
Note: You may want to test the command before actually executing is. In order to do that, add the -n
option to rename
(e.g. between rename
and the 's//'
string).
No comments:
Post a Comment