Operating System - HP-UX
1855469 Members
4103 Online
104111 Solutions
New Discussion

Re: Using find non-recursively?

 
SOLVED
Go to solution
Carlo Henrico_1
Regular Advisor

Using find non-recursively?

Hi All

I need to use a find command because I need to use the -exec functionality, but only on files found in the current directory, not sub-directories. What I am doing is deleting files in the current directory which are older than 10 minutes, but I do not want to delete the files which confirm to the search specification in the sub-directories.

Any ideas please?

Thanks

Carlo

(Score 173/173)
Live fast, die young - enjoy a good looking corpse!
3 REPLIES 3
Tomek Gryszkiewicz
Trusted Contributor

Re: Using find non-recursively?

My only idea is to move the subdirectories and create symbolic links to it... By default, find does not follow symbolic links. But it is only workaround

-Tomek
Con O'Kelly
Honored Contributor
Solution

Re: Using find non-recursively?

Hi Carlo

Try using:
# find / -path "//*" -prune -exec \;

Cheers
Con
T G Manikandan
Honored Contributor

Re: Using find non-recursively?

find . -path "./*" -prune -print|xargs rm