Bash - Scripting
#!/bin/sh # 'Crunch-Bang-Bin-Bash' May help you remember?
# This script renames .html files to .txt
# Place this script in the directory and use
# chmod +x test.sh
# followed by ./test.sh
for file in *.html
do
mv "$file" "${file%.html}.txt"
done
See: Advanced Bash-Scripting Guide, GOOD!
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.