Please someone assist me with chmod, I have the following file structure
-dir1
--file1
--file2
--dir1a
---file1a1
---file1a2
--dir1b
---file1b1
---file1b2
How do I chmod 655 to all files under dir1 and all subdir? So all files will have 655 permission and all dir will remain as they were.
Thank you
Better to use
The other proposed solution from @sagarchalise will not work if filenames contain spaces or start with a dash.
I think going inside
dir1
andfind . -type f | xargs chmod 655
will do the trick.
Or this version, which supports file names with spaces:
find . -type f -print0 | xargs -0 chmod 655