Setting file permission for Files and Directories

file, linux, permissions, shell

Solution

Backslash before semi-colon (or quotes around it):

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

The shell sees the semi-colon you typed as the end of the command and does not pass it to `find`, which then complains that it is missing.

Problem

I need to apply below permission policies to my files under `www` folder 664 to all files in www recursively, 755 to all directories under www recursively I tried ``` find . -type f -exec chmod 644 {} ; find . -type d -exec chmod 755 {} ; ``` But always getting error ``` find: missing argument to `-exec' ``` What is the solution?

Original source