Hi I am using the below to check for the files which are owned by user not defined in system configuration:
df --local -P | awk {'if (NR!=1) print $6'} | xargs -I '{}' find '{}' -xdev -nouser -ls
The result is:
3282546 0 lrwxrwxrwx 1 613 users 19 Feb 12 12:46 /apps/omni/streams/lib32/libstreams.c -> ../lib/libstreams.c
The actual file has owner,group as:
# ll /apps/omni/streams/lib/libstreams.c
-r--r--r-- 1 root root 7668 Jan 17 2014 /apps/omni/streams/lib/libstreams.c
I want to change the owner,group of the link as well to root. I'm using the below, but it doesn't work:
df --local -P | awk {'if (NR!=1) print $6'} | xargs -I '{}' find '{}' -xdev -nouser | xargs chown root:root
Anything I'm missing ?