[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: find usage question

From: Eric Blake
Subject: Re: find usage question
Date: Tue, 19 Mar 2019 11:50:29 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 3/19/19 10:56 AM, Budi wrote:
> How to instruct 'find' to perform -exec with its argument is from
> -printf, not from the default find output.
> tried so far in vain:
> find ~+ -type d -printf '%p /d/data/%p_%s\n' -exec cp \{\} \

You can't. But what you can do is:

find ... -printf 'cp %p /d/data/%p_%s\n' | xargs -L1

where you instruct the -printf form to output the entire command you
want executed (rather than trying to piece together the command with
-exec), and instead have xargs execute it.

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]