LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   find / -name *.test | chmod 751 (https://www.linuxquestions.org/questions/linux-newbie-8/find-name-%2A-test-%7C-chmod-751-a-427672/)

Bonestein 03-23-2006 10:03 AM

find / -name *.test | chmod 751
 
What I am trying to do is take the output of

find / -name *.test

and change the permissions on each file

like a

find / -name *.test | chmod 751

but that doesn't work. so does anyone know how to make it work?

P.S. Each .test file is in a different directory and subfolder

reddazz 03-23-2006 10:14 AM

You would do something like this
Code:

#find / -name "*.test" -exec chmod 751 {} \;

mikshaw 03-23-2006 10:18 AM

Just for the sake of options, here's another way:
Code:

for i in `find / -name *.test`; do chmod 751 $i;done

Bonestein 03-23-2006 10:18 AM

Thanks for the help

this worked

find / -name \*.test -exec chmod 755 {} \;


All times are GMT -5. The time now is 06:45 PM.