Update chmod on php files only

I am sick and tired of having to search for this every time I need it, so now you’ll get it for free.

The following is a small script that you can use on any folder you wish… just pass the folder name to the script.

#!/bin/bash

die () {
echo >&2 “$@”
exit 1
}

[ "$#" -eq 1 ] || die “1 argument required, $# provided”

find $1 -type f -name ‘*.php’ -exec chmod 600 {} ;

Copy and paste into a new file called whatever you like and make it executable with: “chmod +x scriptname”

Tada!

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

0 Response to “Update chmod on php files only”


  • No Comments

Leave a Reply