>_ IzzyLab

Topic breakdown

Many commands (including rm) have no "read the list of targets from a file" mode — they expect names as arguments. The bridge between a text stream and command arguments is xargs: it reads words from standard input and substitutes them into a call to the given command. By default xargs splits its input on any whitespace, so for paths with spaces the delimiter should be explicitly set to the newline only (see the -d flag), and the list itself is fed in via < redirection.

What's checked

  1. listed files without spaces deleted
  2. the listed file with a space in its name deleted
  3. files not on the list preserved

What it looks like