Locating files!

My question is :
-How do I locate files of specific user in specific folder.
In other words, How do I find files that belong only to "root" user, in /etc folder?

find /etc/ -user root 2>/dev/null

Note: Use /usr/xpg4/bin/find

1 Like

Thanks ALOT!

whats does 2>/dev/null do or mean?

It tells the shell to redirect all error messages (if any) into the void (/dev/null).

1 Like

Why /usr/xpg4/bin/find ?
IMHO it only differs from /bin/find in the interpretation of -name '*' and is not relevant here.

Just the habit I guess. More than once I've seen a Solaris script fail because the default binary doesn't work the same as the one under non-standard directories.

Nothing against Solaris, though; just how it makes a mess of binaries in /usr/bin, /usr/css/bin, /usr/xpg6/bin, /usr/xpg4/bin, etc.