Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
7 user(s) are online (3 user(s) are browsing encyclopedia)

Members: 0
Guests: 7

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

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 Pipe (Unix) 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 UNIX shell, 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 subdirectory 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=

  • [http://unixhelp.ed.ac.uk/CGI/man-cgixargs GNU man page on xargs]