Skip to content

Instantly share code, notes, and snippets.

@prashantksharma
Last active October 11, 2018 18:54
Show Gist options
  • Save prashantksharma/8b138602eab17995c032d6e539910c70 to your computer and use it in GitHub Desktop.
Save prashantksharma/8b138602eab17995c032d6e539910c70 to your computer and use it in GitHub Desktop.
Bash script to change all the php files with .html extension
#!/bin/bash
# Usage: bash php-to-html.sh /path/to/folder
# If you get permission denied error do:
# sudo bash php-to-html.sh /path/to/folder
for f in `find $1 -name '*.php'`
do
#echo $f
previous=$f
updated=${f%.php}.html
mv "$f" "${f%.php}.html"
echo "FILE: $previous"
echo "RENAMED: $updated"
done
@prashantksharma
Copy link
Author

script-demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment