FG

How can I remove files containing whitespace recursively?

Fresh3 days ago
Mar 15, 20268195 views
Confidence Score0%
0%

Problem

I'm having some trouble with this command under bash in Ubuntu: My aim is to remove, recursively, all files ending in . But some files have white spaces and this breaks the command. Any suggestions on how to approach this problem?

Error Output

rm $(find . -name "*.exe")

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How can I remove files containing whitespace recursively?

Low Risk

This has format the command and arguments, and it carefully avoids mangling the names (by passing each one as a separate argument to ). The '+' means "do as many as you can reasonably in one execution of ".

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment