Bash: Batch rename files using the command line

Posted . Visible to the public.

Need to change the file extension for a bunch of files in your git repository? try:

find app/ -name '*.css.scss' -exec sh -c 'git mv "$0" "${0%.css.scss}.scss"' {} \;

This particular command finds all .css.scss files in the app folder and then iterates over them to rename them to .scss instead.

adre
Last edit
adre
Posted by adre to Foxsoft (2015-07-15 08:57)