The first step:
Edit the text, you can change the script according to your own requirements :
#!/bin/bash
#chmodall text file to read and write;
find~-name "*.doc*"-exec chmod 644-r {} \;
find~-name "*.xls*"-exec chmod 644-r {} \;
find~-name "*.ppt*"-exec chmod 644-r {} \;
find~-name "*.pdf"-exec chmod 644-r {} \;
find~-name "*.txt"-exec chmod 644-r {} \;
find~-name "*.hlp"-exec chmod 644-r {} \;
find~-name "*.wps"-exec chmod 644-r {} \;
find~-name "*.rtf"-exec chmod 644-r {} \;
find~-name "*.htm*"-exec chmod 644-r {} \;
#chmodall picture to read and Wirte;
find~-name "*.png"-exec chmod 644-r {} \;
find~-name "*.jpg"-exec chmod 644-r {} \;
find~-name "*.bmp"-exec chmod 644-r {} \;
find~-name "*.jpeg"-exec chmod 644-r {} \;
find~-name "*.gif"-exec chmod 644-r {} \;
find~-name "*.dwg"-exec chmod 644-r {} \;
find~-name "*.pic"-exec chmod 644-r {} \;
find~-name "*.tif"-exec chmod 644-r {} \;
#chmodall Compress to Read&write:
find~-name "*.rar"-exec chmod 644-r {} \;
find~-name "*.zip"-exec chmod 644-r {} \;
find~-name "*.arj"-exec chmod 644-r {} \;
find~-name "*.gz"-exec chmod 644-r {} \;
find~-name "*.bz*"-exec chmod 644-r {} \;
#chmodall Video to Read&write:
find~-name "*.avi"-exec chmod 644-r {} \;
find~-name "*.mp3"-exec chmod 644-r {} \;
find~-name "*.wav"-exec chmod 644-r {} \;
find~-name "*.mp4"-exec chmod 644-r {} \;
find~-name "*.swf"-exec chmod 644-r {} \;
#chmodall Source code to r&w;
find~-name "*.h"-exec chmod 644-r {} \;
find~-name "*.c"-exec chmod 644-r {} \;
find~-name "*.java"-exec chmod 644-r {} \;
# To this end, the script ends
Step Two: Save the script file as Chmymod
Step Three: Modify the permissions of the script: chmod644 Chmymod
and move the script under/bin !
by this, it's over. All you have to do is enter chmymod on the command line to see the effect.