Operating System - HP-UX
1752604 Members
4484 Online
108788 Solutions
New Discussion юеВ

Re: find file owner not = oracle

 
SOLVED
Go to solution
Donald Thaler
Super Advisor

find file owner not = oracle

i would like to search thru the oracle_home directory looking for files or sub-directories that don't have 'oracle' as the owner .
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: find file owner not = oracle

Hi Donald:

# find /path ! -user oracle -exec ls -ld {} +

...list them.

Regards!

...JRF...
Viktor Balogh
Honored Contributor

Re: find file owner not = oracle

"don't have oracle as the owner"

here is the one-liner for you:

# find /path_to_oracle_home ! -exec ls -ld {} \+ | awk '{if ( $3 != "oracle" ) print $0}'

****
Unix operates with beer.
Dennis Handly
Acclaimed Contributor

Re: find file owner not = oracle

>Viktor: # find /path_to_oracle_home ! -exec ls -ld {} + | awk

It is better to use JRF's find solution than to make the pipe sweat by passing in ALL of the Oracle files.

Viktor Balogh
Honored Contributor

Re: find file owner not = oracle

oh, I just recognized the exclamation mark as a negation, I thought it is there just to note that the 'path' should be altered.
sorry, my mistake, I didn't know that find accepts exclamation to negate.
****
Unix operates with beer.