help-bash
[Top][All Lists]
Advanced

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

[Help-bash] how to understand the xargs


From: lina
Subject: [Help-bash] how to understand the xargs
Date: Tue, 27 Dec 2011 00:11:59 +0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16

Hi,

I don't understand the xargs well,

can someone help me understand the below sentence,

ls . | xargs -i -t cp ./{} {}.bak

How does xargs work,

I checked google, :
-i : replace the string
-t print
but still lack well understanding,

how those xargs organise things,

and
$ ls .
a.txt b.txt

above will give a.txt.bak b.txt.bak
ls | xargs -i cp ./{} {basename {}.bak}
definitely not work,

Thanks with best regards,



reply via email to

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