On 07/24/2010 01:18 AM, Rony wrote:
Hello,
I want to use the find command inside a directory which has user1, user2, user3 and user4 in the group to either look for files owned by user1 or user2 or user3
or
find files not owned by user4.
The -user option allows me only one name. I tried spaces, comas between user_names but the syntax is returned invalid. I can't find the not_owned option either. The -nouser option is for users not in the /etc/passwd file which is not my case. Checked out google too but cannot find any possibility for multi-user options in the same line. Even tried -user user1 -user user2 -user user3 together but not working. If I can write one 'find' line for all the users, I don't have to repeat it per user.
Any tips or tricks?
find /path/to/dir -user user1 -o -group user2 -not -user user3
this above command with find all files owner by user1 or group owned by user2 but not owned by user3. Because ...
-user matches the owner of the file -group matches the group owner of the file -o is the 'or' operator -not is the 'not' operator
The info pages (I personally prefer using 'pinfo' to browse the info pages) for find are pretty nicely organized. Take a look.
cheers, - steve