USING XARGS ON MAC TERMINAL

Using Xargs on Mac Terminal

Xargs is used to run commands on the output from other command line programs.
The OS X version is missing the default -I {} that other *nix sytems seem to have.
The following command will search for and print files matching *something*. The xargs is redundant here but gives a good frame work.

$ find . -iname *something* | xargs -I {} echo {}

Or move matching files to another location.
$ find . -iname *something* | xargs -I {} mv {} ../Other/Location

Advertisements