Is there any way of batch renaming files in sub directories?
For example:
Rename *.html
to *.htm
in a folder which has directories and sub directories.
Click the Select all button. Quick tip: Alternatively, you can also use the Ctrl + A keyboard shortcut to select all files. You can press and hold the Ctrl key and then click each file to rename. Or you can choose the first file, press and hold the Shift key, and then click the last file to select a group.
Windows command prompt: (If inside a batch file, change %x to %%x)
for /r %x in (*.html) do ren "%x" *.htm
This also works for renaming the middle of the files
for /r %x in (website*.html) do ren "%x" site*.htm
find . -regex ".*html$" | while read line; do A=`basename ${line} | sed 's/html$/htm/g'`; B=`dirname ${line}`; mv ${line} "${B}/${A}"; done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With