Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Command (Find more than one -user)

Status
Not open for further replies.

ITGoddess

IS-IT--Management
Dec 13, 2001
8
US
Greetings!

Attempting to recall what the syntax is for the find command in order to locate files created by two different users. Goal is to take the files created by these two users in /tmp and tar in a different directory with date stamp). Thus far:

tar -cvf /db2/eomrpts/`date +"%y%m%d`.tar `find /tmp "-user one | -user 2" -mtime 0`

Many thanks for your help!

Regards,
-Michelle
 
Hi,
the '|'(or) bar in find is

-o

and the '&'(and) is

-a

I typically use parenthesis to Group my criteria.

In CSH you need to escape the '(' and ')' or the csh wont pass it to the find properly.

find /tmp \( -m 0 -o -m 1 -o -m 2 \) -print



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top