System Management
An administrator must delete all .bak files under /srv/uploads (none have whitespace in their names) and save the list of deleted paths to /tmp/bak.lst in a single pipeline. Which command does this?
Show the answer
Correct answerC. find /srv/uploads -name '*.bak' | tee /tmp/bak.lst | xargs rm
tee writes the path list to the file and passes it unchanged to xargs, which supplies the paths to rm as arguments. Placing tee after xargs rm captures only rm's output, which is empty. rm ignores standard input, so it cannot take the paths from a pipe.