Dev License: This installation of WHMCS is running under a Development License and is not authorized to be used for production use. Please report any cases of abuse to abuse@whmcs.com

Mass File Renaming Print

  • 3

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

Powered by WHMCompleteSolution