Xargs: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Linux")
 
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:


* [[Linux#Commands|Linux]]
* [[Linux#Commands|Linux]]
=Overview=
<tt>xargs</tt> is useful to turn stdout-generated content into commands that are immediately executed.
<tt>xargs</tt> reads space/tab/newline and end-of-file delimited strings from standard input and executes the specified "utility" with the strings as argument:
... | xargs <''utility''>
echo "a.txt b.txt" | xargs ls -l
builds and executes:
ls -l a.txt b.txt

Latest revision as of 00:32, 30 July 2019

Internal

Overview

xargs is useful to turn stdout-generated content into commands that are immediately executed.

xargs reads space/tab/newline and end-of-file delimited strings from standard input and executes the specified "utility" with the strings as argument:

... | xargs <utility>
echo "a.txt b.txt" | xargs ls -l

builds and executes:

ls -l a.txt b.txt