How to change file permission for all sub-directories (CHMOD)

ptamzz picture ptamzz · Oct 5, 2011 · Viewed 27.4k times · Source

I've a directory, inside which I've multiple directories each containing several image files.

I want to change the file permissions to 755 for all the sub-directories and the image files inside them.

I'm using WinSCP to connect to the server. So how do I change the file permissions in one go as I can't keep changing one by one since there are lots of files.

Answer

nachito picture nachito · Oct 5, 2011

If you have shell access to the server you can execute

chmod -R 755 {DIR}

The -R means recursive.

Edit: If you only have access via WinSCP you should be able to select the files/directories you want and change the permissions recursively