Skip to content
Search

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

List of text processing commands

Text

Common

grep, sed, awk, cat, xargs, rev, tee, ack, tr, stdbuf, split

Diff

diff, patch

Cutting

cut, head, tail, less, more, split, watch

Sort

uniq, sort

Hash

base64, md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum

Clipboard

clip (Windows), pbcopy (Mac OSX), pbpaste (Mac OSX), xclip (Debian)

E.T.C

regexp, parallel

Favorite site

author Zer0 sitemap