I want to delete a bunch of unnecessary text files in a pile of NOVA episodes I have archived. Ok, no problem...
$ cd ~/Movies/NOVA/ $ find . -name '*.txt' | xargs rm rm: cannot remove `./NOVA': No such file or directory rm: cannot remove `-': No such file or directory rm: cannot remove `Search': No such file or directory rm: cannot remove `For': No such file or directory rm: cannot remove `A': No such file or directory rm: cannot remove `Safer': No such file or directory rm: cannot remove `Cigarette': No such file or directory Oh that's right, in Unix nobody would ever possibly put a space in a filename (a hate for later). So I need to separate things with a null byte, ok... $ find . -print0 -name '*.txt' | xargs -0 rm Whoopsie, everything's deleted. 10 gigs of fine public educational video, gone. Turns out putting -print0 first instead of last causes some sort of crazy find switch boolean madness to short circuit and everything becomes true. I'm sure there's some perfectly self-consistent, logical and yet still TOTALLY INSANE reason why this is so making find the well-dressed, but completely off his rocker guy on the bus trying to convince you to remove the plastic border >from around your license plate. To save fuel. Because your car will weigh less. [1] Makes perfect sense, right? Hate. [1] No joke, he had little pamphlets with the math and everything. -- The interface should be as clean as newly fallen snow and its behavior as explicit as Japanese eel porn.