Checking multiple results

(imported topic written by IanR2974)

Hi,

I am trying to check permissions on all files located in a folder on a red hat 5 system. They should all be the same so i need to find out if there is a file which doesnt have the correct permissions set and for the purpose of the check needs to just evaluate as true.

Relevance to get list is:-

modes of find files “*” of folder “/home/%username%/training/testdir/logextracts/”

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwx------

A: rwxr–r--

A: rwx------

A: rwx------

Is there a way to check this. I have looked at different ways but cant seem to find anything that works as it should. Need a fresh pair of eyes :slight_smile:

Thanks in advance.

(imported comment written by IanR2974)

I have done some further digging and found the following relevance has worked a treat in case anyone else gets this.

exists (files of folder “/home/%USERNAME%training/testdir/logextracts”) whose ( mode of it as string != “rwx------” )

Seems so simple now i look at it. Can’t believe i didn’t get this first time.

(imported comment written by dmoore21)

Are you sure that’s the correct relevance? Whenever I try that, I get a “string constant had an improper %-sequence” error…

(imported comment written by IanR2974)

Apologies i should have made it clear i changed my actual username with “%USERNAME%” so as not to give it away (perhaps too paranoid, but you never know :slight_smile: )which is probably why you are getting this error. If you change this to your username (if using your home directory) it should work.

I have tested this on a number of fixlets checking files of different folders and has worked fine for me.

(imported comment written by dmoore21)

Ah - I thought you were attempting to check all of the home directories for all users on the system… My mistake.