I would like to chmod
all folders and subfolders within a specific folder, except I wish to exclude one folder (and all subfolders it contains).
What I have so far is a hack of the following solutions from StackOverflow:
- How to set chmod for a folder and all of its subfolders and files in Linux Ubuntu Terminal?
- Exclude directory from find . command
Here is what I came up with so far:
find . -type d \( -path ./node_modules \) -prune -o -print -exec chmod 644 {}\;
The problem is with or without -print
I receive the following error :
find: missing argument to `-exec'
The following line has the expected results I need -exec chmod 644{}\;
to read from:
find . -type d \( -path ./node_modules \) -prune -o -print
What am I missing on that line to pipe the data to -exec
?
Best Answer
Remove
-print
, escape( and )
and add space after{}