Mass File Renaming Print

  • 0

This little snippet will help you to rename a list of files with a .xhtml extension to a .html extension.

for i in *.xhtml; do mv $i $(echo $i | sed -e 's/.xhtml/.html/'); done

The script is run from the folder containing the list.
The for .. do loop assums the file list from the current folder.
This will not work recursively / act upon contents of child folders.
Each element from the loop is moved from $i (current name) to sed -e s/find/replace/'.
sed can be replaced with any logic for adjusting the value of $i.

Was this answer helpful?

« Back