I want to find a bash command that will let me grep every file in a directory and write the output of that grep to a separate file. My guess would have been to do something
A solution without xargs is the following:
xargs
find . -mindepth 1 -maxdepth 1 -type f -exec sh -c "grep ABC '{}' > '{}.out'" \;
...and the same can be done with xargs, it turns out:
ls -1 | xargs -I {} sh -c "grep ABC '{}' > '{}.out'"
Edit: single quotes added after remark by lhunath.