find . -perm 0444 -print -o -perm 0440 -print -o -perm 0400 -print

Assuming they're not mode 0000 or 0040 or something goofy.

man find and look at the examples of -perm -mode , -perm /mode , and the
examples.

Ben

On Mon, May 22, 2017 at 08:57:12PM -0700, Howard Sanner wrote:
> Is there any easy way (easy = I don't have to write a program in C) to
> search for files in a directory tree with certain permissions? I looked at
> the man page for ls and didn't see anything obvious.
> 
> Here's what's going on. At some point some of my WAV files got their
> permissions set to read only. I don't know whether that's because I got the
> not-so-bright idea that that way they couldn't be deleted, or if I used
> chmod recursively without thinking through the ramifications. Either way,
> now, when I try to back them up to a USB HD, I get lots of permission denied
> error messages when trying to copy those files.
> 
> I've fixed a lot of them by hand, but there are still some "problem
> children" out there. So if I could find all the files for which the owner
> has only read permission and directories for which the owner has other than
> rwx permission, that would be A Good Thing. Since there are hundreds of GB
> of these files, running cp -a -r until it reports an error is very time
> consuming.
> 
> Thanks for your advice.
> 
> Howard Sanner
> linux-au...@terrier.ampexguy.com
> a Terp of 1975 vintage

-- 
Ben Stern
This space intentionally left blank.

Reply via email to