jogi on April 15, 2011, 08:41:18 AM
Hi,
    I use Granular 1.0  usb for booting and my hard disk for data backup. The partitions on hard disk originally was of type ntfs which i later formatted to ext3 type. All the files on my hard disk had rwxrwxrwx permissions. Some files on the disk also getting corrupted  automatically, I suspect, due to some virus activity and I deleted them. Now files are not getting corrupted but how can i change the file permissions of all my files on the hard disk to rw_r__r__. The process of changing them one by one is very lengthy process.
 I tried chmod a-x *.*  It did not work
then find .-name \*.* -exec chmod a-x \{\}\;           it did not work [error no argument to -exec]
then
        for x in 'find .\name \*.*'; do chmod a-x "$x"; done     it again did not work .
please help if there is any solution to this problem
 

Anurag Bhandari on April 16, 2011, 07:48:23 AM
First, make sure in this case you are issuing the chmod command as root.

Second, don't chmod the root partition. Use chmod only on your data files.

Third, try changing file permissions recursively, so that chmod is applied to all files and sub-folders of a folders. Here's the command to get rw-r-r:
Code: [Select]
chmod -R 644 <folder-name>

jas on May 18, 2011, 04:12:27 PM
Thanks,
           Anurag.
                      It worked and the problem was solved.


Anurag Bhandari on May 20, 2011, 07:38:12 AM
Great. :)