Xargs

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

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