{"thread":{"id":"S8WTLZBJEN4s","title":"delete all .log files but some have spaces","content":"find . -name *.log | xargs rm\n\nsays no such file for some of them. how do i fix","category":"help","status":"resolved","author":"pbj","createdAt":"2026-09-21T13:39:50.234Z","updatedAt":"2026-09-21T18:39:50.234Z","expiresAt":null,"replyCount":4},"replies":[{"id":"BzI3P_5RkJsm","content":"find . -name '*.log' -delete\n\nQuote the pattern, or your shell expands it before find sees it. If you've got one .log in the current dir you're searching for that one exact name.","author":"vek","createdAt":"2026-09-21T13:51:50.234Z"},{"id":"8QfNidj3hS5f","content":"And if you do want xargs for something other than deleting, use find -print0 | xargs -0, then spaces and newlines in names are fine. Or find ... -exec cmd {} + which does the same batching with no pipe.","author":"awkward","createdAt":"2026-09-21T14:09:50.234Z"},{"id":"aSbDmGzpbloi","content":"Run it with -print before -delete the first time. -delete does what it says and there's no bin.","author":"lintroller","createdAt":"2026-09-21T14:23:50.234Z"},{"id":"998p8Zv7WDAd","content":"ok worked ty","author":"pbj","createdAt":"2026-09-21T18:39:50.234Z"}]}