find and searching for specific expression in files

Wojciech Puchar wojtek at wojtek.tensor.gdynia.pl
Sat May 30 18:40:39 UTC 2009


> <make-a-list> | while read x; do <pretty-much-whatever> "$x"; done
>
> which should get around the list length limitations and
> provides for doing "extras" between the "do" and the "done".
> Specifically:
>
> find /path/to/files/ -mtime -2 -print | \
> while read x; do grep "expression" "$x"; done

same as -exec

works but forks a process for each single file - slow

-exec and + or xargs do the job


More information about the freebsd-questions mailing list