Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
152
rated 0 times [  152] [ 0]  / answers: 1 / hits: 98184  / 3 Years ago, sun, june 20, 2021, 11:46:57

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


More From » chmod

 Answers
1

Better to use



find . -type f -exec chmod 655 -- {} +


The other proposed solution from @sagarchalise will not work if filenames contain spaces or start with a dash.


[#43741] Tuesday, June 22, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eeperant

Total Points: 39
Total Questions: 106
Total Answers: 117

Location: Finland
Member since Sat, Dec 5, 2020
3 Years ago
;