Dani 2,128 The Queen of DaniWeb

Earlier today, I was in need of an easy way to delete files that mached a specific format within a series of folders. For the case of this example, let's say all CSS files. I discovered I could do it with:

find . -name '*.css' -delete

The . represents the current folder and below. Unfortunately you can't use rm -r because it doesn't recursively check for file names matching a pattern.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.