Computer Hope

Software => BSD, Linux, and Unix => Topic started by: doncamillo on April 26, 2008, 03:35:59 AM

Title: how to: change chmod to 777 of all files in a spesific name in whole server
Post by: doncamillo on April 26, 2008, 03:35:59 AM
Is it possible to change chmode of a spesific file but in different folders?

change all x.php in /home folder. There are lots of x.php and i dont want to change chmod one by one.

is it possible to do this with one shot?

tnx
Title: Re: how to: change chmod to 777 of all files in a spesific name in whole server
Post by: ghostdog74 on April 26, 2008, 04:27:57 AM
Code: [Select]
find /home -type f -name "X.php" -exec chmod 777 "{}" \;
Title: Re: how to: change chmod to 777 of all files in a spesific name in whole server
Post by: doncamillo on April 26, 2008, 07:47:59 AM
Thank you very very much. I am searching this command for days. And it worked.

what if change a permision of a FOLDER not file?


How can we do this?
Title: Re: how to: change chmod to 777 of all files in a spesific name in whole server
Post by: ghostdog74 on April 26, 2008, 08:03:50 PM
Thank you very very much. I am searching this command for days. And it worked.

what if change a permision of a FOLDER not file?


How can we do this?
check the man page of find command. look for -type explanation.
Title: Re: how to: change chmod to 777 of all files in a spesific name in whole server
Post by: doncamillo on April 28, 2008, 06:40:14 AM
Tnx again.

"-type d"

:)