Finding files with certain permissions

Viewed 154

I need to find all files in the current directory that cannot be written on by the user but can have any other permissions.

I'm trying to use find . -type f -perm -u=r+x but it's not working properly. I need to display files that only the user is unable to write on. I don't understand why my code is not working.

1 Answers

This should work :

find . -type f ! -writable

Or if you wanna use -perm instead use this:

find . -type -f ! -perm -u=w

the negation operaror is anyways helpfull.

Related