How to limit Unix find number of results to handle directories with many files
It sounds like you're looking for xargs, but don't know it yet.
find /some/log/dir -type f -name "*.log" | xargs rm
You could try something like find [...] |head -[NUMBER]
. This will send a SIGPIPE
to find
when head
outputs its however-many lines so that find
doesn't continue its search.