find excluding the hidden files

Hi ,

I am trying to use the find command with delete in a directory . Even though i use a wil character search the find command is checking the hidden files which inturn results in error .

Can i avoid look that into the hidden files ?? I am using HP unix .

find /cv1/ -name "ite*" -mtime +14 -exec rm -f -r

HIw can modify the above command so that i exclude the hedden files or directory when searching ..

PLease let me know if is urgent

Thanks,
Arun

Check the syntax of the find command. It is missing the curly braces {} that represent the files returned by find and it should be terminated by an escaped semi-colon \;

find /cv1/ -name "ite*" -mtime +14 -exec rm -fr {} \;

I am not sure what you mean by hidden files or directories?

He means files prepended with a period, .hidden for example.

You can use a regex to exclude these files and directories:

find . \( ! -regex '.*/\..*' \)

Hi

find /wsfer/cre/ -name "mod*" -mtime +14 -exec rm -f -r 2> /dev/null "{}" ";"

This was the command i used the syntax was right ..
I even though tried the regex you suggested it was not working . I am using HP UNIX.

Even though i used /dev/null after this command when i tried $? the status i am geeting is 1 if the permision denied . Why it is happening .
And how to exclude the hidden files and directory in the above command . Please help.

Thanks
Arun.