Go to the first, previous, next, last section, table of contents.


Interspersing File Names

xargs can insert the name of the file it is processing between arguments you give for the command. Unless you also give options to limit the command size (see section Limiting Command Size), this mode of operation is equivalent to `find -exec' (see section Single File).

--replace[=replace-str]
-i[replace-str]
Replace occurences of replace-str in the initial arguments with names read from standard input. Also, unquoted blanks do not terminate arguments. If replace-str is omitted, it defaults to `{}' (like for `find -exec'). Implies `-x' and `-l 1'. As an example, to sort each file the `bills' directory, leaving the output in that file name with `.sorted' appended, you could do:
find bills -type f | xargs -iXX sort -o XX.sorted XX
The equivalent command using `find -exec' is:
find bills -type f -exec sort -o '{}.sorted' '{}' ';'


Go to the first, previous, next, last section, table of contents.