FACTOID # 11: The USA has more personal computers than the next 7 countries combined.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Xargs

xargs is a command of the Unix and most Unix-like operating system which eases passing command output to another command as command line arguments.


It splits its often piped input at whitespaces (or the null character) and calls the command given as an argument with each element of the split input as parameter. If the parameter list is too long, it calls the program as often as necessary. It often covers the same functionality as the backquote feature of many shells, but is more flexible and often also safer, especially if there are blanks or special characters in the input.


This is often used in conjunction with the Unix commands find, locate and grep.


Example

  • find . -name "*.foo" | xargs grep bar in practice does the same as grep bar `find . -name "*.foo"`, but will work even if there are so many files to search that they will not all fit on a single command line. It searches in all files in the current directory and its subdirectories which end in .foo for occurrences of the string bar.
  • find . -name "*.foo" -print0 | xargs -0 grep bar does the same thing, but uses GNU specific extensions to find and xargs to separate filenames using the null character; this will work even if there are whitespace characters, including newlines, in the filenames.

External links

  • GNU man page on xargs (http://unixhelp.ed.ac.uk/CGI/man-cgi?xargs)

  Results from FactBites:
 
Xargs - definition of Xargs in Encyclopedia (215 words)
xargs is a command of the Unix and most Unix-like operating system which eases passing command output to another command as command line arguments.
It splits its often piped input at whitespaces (or the null character) and calls the command given as an argument with each element of the split input as parameter.
does the same thing, but uses GNU specific extensions to find and xargs to separate filenames using the null character; this will work even if there are whitespace characters, including newlines, in the filenames.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.