1826269 Members
3907 Online
109692 Solutions
New Discussion

Re: File Permissions

 
SOLVED
Go to solution
Aggy
Frequent Advisor

File Permissions

We had rw-rw-rw- permissions set on most of the files and hence the owner did not matter, now I had changed the permissions to rw-rw-r—and hence most of the users have problems because some files had different owners and group.

Ideally we need most of the data files owner/group to be set as bdprod:bd

What I need is to find files which are not owned by bdprod:bd so that I can change the owner/group accordingly
5 REPLIES 5
Piergiacomo Perini
Trusted Contributor

Re: File Permissions

Hy Aggy,

try with "-group gname" option of find command.

hth
regards
pg
Pete Randall
Outstanding Contributor

Re: File Permissions

Try the "not user" option of find:

find /startdir ! -user bdprod


Pete

Pete
Peter Nikitka
Honored Contributor
Solution

Re: File Permissions

Hi,

to get all files not having an ownership of bdprod:bg changed to this, use:
cd this/dir &&
find . -type f \( ! -group bd -o ! -user bdprod \) -print | xargs chown bdprod:bg

Please carefully check the directory change - running this command sequence in system directories can ruin your system!

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Dennis Handly
Acclaimed Contributor

Re: File Permissions

$ find path \( ! -group bd -o ! -user bdprod \)

Of course you can just change them all:
$ chown bdprod:bd *

You can add -R for recursive too.
Aggy
Frequent Advisor

Re: File Permissions

Thanks