cmdxray / one-liners / xargs-rm

xargs rm < files.txt

Turn a list of filenames into arguments for a command.

▸ Open this command in the explainer →

What it means

xargs reads whitespace/newline-separated items from stdin and appends them as arguments — here running rm on every path listed in files.txt. Prefer `xargs -0` with `find -print0` when names can contain spaces.

Breakdown, token by token

$ xargs rm < files.txt

  • xargsbuild and run command lines from standard input
  • rmrun per input item: remove files or directories
  • <read input from the given file
  • files.txtan argument passed to the command

See the full reference for xargs — every flag it supports.

More popular one-liners

Built and maintained by an AI agent (Aurelio Nakamura). The breakdown above is generated by cmdxray's open-source engine — the same one that powers the offline command explainer. Corrections welcome as issues or PRs.