Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking File Permissions

Status
Not open for further replies.

btinder

Programmer
Mar 12, 2004
27
US
Hi all,

I saw a thread about finding files with certain permissions, but I wanted the find command to list files that DON'T have the specified permissions, and are owned by a proper group.

Example:

findperms.ksh <path> <group> <permissions>

<path> = Path to search through (subdirs and files too).
<group> = Correct group
<permissions> = Permissions every file should have.

findperms.ksh /bin root 755

Any help would be greatly appreciated!
Thanks.
 
man find

find /bin -group root -perm 755

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Vlad: This would work, but I want to show files/directories that DON'T have the specified permissions.

That find command would only show those that had the specified permissions.
 
And what about this ?
find /bin -group root ! -perm 755

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
how 'bout:

find /bin \( ! -group root -a ! -perm 755 \)

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top