Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

How to chmod files that have a specific set of permissions

Writer Matthew Barrera

I want to find all files in a folder that have -rw-r----- (640? is that the right code?) permissions, and change them all to have -rw-rw-rw- instead. How do I do this, with chmod?

I know I could do the whole folder with

sudo chmod -R 666 /path/to/folder

but I think (perhaps mistakenly?) that it would be more efficient to just do the ones that actually need it?

Alternatively, rather than specifically looking for -rw-r-----, I could chmod any file that doesn't have 666 already? Would that be better?

4

1 Answer

find /path/to/folder -perm 640 -exec chmod 666 {} \;
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy