Tigran Khachikyan
Tigran Khachikyan

Reputation: 302

Find files which do not have read permissions for other

I want to get all files which do not have read permissions for others. I've tried find . -type f -perm -o-r and find . -type f -perm -o But they return all files. Seems I'm doing something wrong.

Thanks.

Upvotes: 0

Views: 99

Answers (2)

anubhava
anubhava

Reputation: 785128

You can use:

find . -type f ! -perm -o+r

Upvotes: 1

choroba
choroba

Reputation: 241858

Just search for anything that doesn't have the read permission for others:

find -not -perm -o=r

Upvotes: 1

Related Questions