grep, maybe

David Rosenstrauch darose-prQxUZoa2zOsTnJN9+BGXg at public.gmane.org
Thu Oct 29 11:52:12 EDT 2009


On 10/29/2009 11:47 AM, John Abreau wrote:
> Assuming no spaces or other troublesome metacharacters
> in the filenames and folder names:
> 
>     mv $( find /path/to/src/root -type f | xargs grep -l moe |
>         sed 's-/[^/]*$--' | sort -u ) /path/to/destination/

If there are spaces, then change it to:

... find /path/to/src/root -type f -print0 | xargs -0 grep -l moe ...

DR





More information about the Discuss mailing list