Xargs
lastmod 2026-02-06created 2015-02-1511 edits
The xargs command reads input data line by line and turns it into arguments.
Command options
-
-i - Tells the xargs command to replace the
"{}"part with the name of each item. - In addition, another difference of this option is that xargs is applied per LINE.
- ex)
find . -name "pattern" | xargs -i mv {} {}.bak
-
-I [replstr](common to MAC OSX & Linux) - Same as
-i, but on MAX OSX it has been replaced by-I(uppercase i), and the string to be replaced must be passed as the next argument. That is, enter it as follows. - ex)
find . -name "pattern" | xargs -I {} mv {} {}.bak - In addition, another difference of this option is that xargs is applied per LINE.
-
-n [숫자] - Limits the number of parameters.
-
-t - Prints the command to be executed.
Text Processing Commands
|