Posted in Linux commands

“find” with Style, Part 2: Deleting Files

Now let’s delete files with style. The usual command to clean up a directory tree (e.g. to delete .o files) is

$ find . -name '*.o' -exec rm {} \;

As I wrote in an earlier post this calls rm for every single file. A first improvement is to change the terminator at the end of the line:

Continue reading ““find” with Style, Part 2: Deleting Files”

Advertisements