Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple explanation about xargs pls... 6

Status
Not open for further replies.

adaaje

Technical User
May 26, 2006
60
AU
Hi guys,

I have a problem to understand "xargs" command help.
I tried to look at xargs command help, but it's so many function and I don't understand.

Could you guys give me basic understanding or sample to use it ? THX GUYS.
 
Quite simply xargs is used to read strings on standard input, passing as many possible as arguments to a given command. It's normally used to get around the ARG_MAX limitations. 24,576 IBM & 1,048,320 Solaris

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Thank you so much sir,

this is what I'm looking for
 
Hi,

Here is a sample that :
lists files.log
wc files.log
and finally
lists files.log and passes them as arguments to wc command in a pipe

Code:
root:/tmp> ls *log
configure.log     cron.log     post_install.log  wlproxy.log
root@ouvea:/tmp> wc *log
     102     713    4555 configure.log
       1       4      67 cron.log
     107     459    3818 post_install.log
       0       0       0 wlproxy.log
     210    1176    8440 total
root:/tmp> ls *log |xargs wc
     102     713    4555 configure.log
       1       4      67 cron.log
     107     459    3818 post_install.log
       0       0       0 wlproxy.log
     210    1176    8440 total
root:/tmp>
 
A useful link mrn, I learnt something new from it. Have a star!

Ceci n'est pas une signature
Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top