To rename all html files in a particular directory to shtml files, use the following loop:
for file in *.html
do
mv ${file} ${file%%.html}.shtml
done
This uses the ${variable%%match} format which strips the longest match from the end of the variable.
Leave a Reply