Linux Pipelines, xargs, split, diff, and Practical Recipes Cheat Sheet/Pass stdin items as arguments
Convert lines into command arguments.
Section: xargs
Pass stdin items as arguments
bash
bash
printf '%s
' file1 file2 file3 | xargs rmExplanation
`xargs` is often used when one command produces a list of items and another command needs them as arguments.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing xargs
Use a placeholder in the command
Insert each item into a custom position.
Replace text across many files safely
Search files first, then edit in place.