How could I mass chmod thousands of files in the same folder? The FTP programs I've used (CoreFTP and SmartFTP) only show up to 2000 files in my folder, but there's about double that realistically (cPanel shows them all). Anyone know how I can do a mass chmod using another program or method? Thanks!!!!
If you have shell access, the command-line chmod program can do it for you. Just use the -R switch (chmod -R 755 dir/ for instance).
I've heard about shell access before, but I'm more of an FTP guy... how would I go about doing that? Thanks again!
Download PuTTy, find your login credentials, login, CD to the right folder (optional) and issue that command.
Ok thanks for the quick reply. If putty comes back and tells me I don't have shell access enabled, what should I do? Ask my host?
If they can't enable the shell access, you can request them to change the permissions of all the files. It will not take more than a minute to change the permissions. Kailash
Hello, I had a problem about this when I was installing magento commerce, since I am hosted at hostgator. Magento's installation files does not allow for permission 777 and 664, so I had to change all of magento's files to 755 and 644 (that's several hundred files). So I researched a bit and found a script that worked for me. In my situation, since all directories are in 777 and files are in 664, I had the script like this: ----------------------------------------------------------------------- <?php function rChmod( $dir = "./", $dirModes = 0755, $fileModes = 0644 ){ $d = new RecursiveDirectoryIterator( $dir ); foreach( new RecursiveIteratorIterator( $d, 1 ) as $path ){ if( $path->isDir() ) chmod( $path, $dirModes ); else if( is_file( $path ) ) chmod( $path, $fileModes ); echo $path."<br />\n"; } } rChmod( "./some/dir" ); ?> ----------------------------------------------------------------------- Just replace "./some/dir" with the path of your folder, mine looks like: "home/xxxx/ssss/nnn/" Save the file as something.php Load the file in your root, and then run the file in any browser, and voila! It should work, it worked for me flawlessly Good Luck! --Marianne Get a Free 5 Minute Psychic Reading at http://www.trupsychics.com
sudo chmod -R 777 /var/www/* notice the Asterisk * it says that all files after www/ will be set to 777
or something like: find /root/folder/name -type f -exec chmod 644 {} \; may change all files recursivelly permissions. -type d means directory, type f is files