Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 2
    In a nutshell, find..exec can handle weird filenames on its own.. Commented Nov 15, 2015 at 4:05
  • 4
    The first rule of linux club is you do not parse ls Commented Nov 15, 2015 at 4:41
  • 1
    Perhaps it's in reference to "passes the raw filename from disk directly into the internal argument list" Commented Sep 27, 2021 at 18:27
  • 1
    What do you do if you need a pipe in your exec command? The accepted answer on this site is to find . -exec sh -c "echo {} | wc -c" \; (as an example). But it seems to me like using exec this way doesn't follow the rules of this answer. Commented Apr 23, 2022 at 8:41
  • 1
    Ha! Thanks for taking the time to reply. I think I was extremely tired when I wrote that. Now that I'm alert... TL;DR: Does your answer apply when you want to use a pipe in an -exec string? In detail: By "accepted answer," I meant the highest voted answer for how to pipe commands in an -exec: stackoverflow.com/a/307154/61624 By "the rules of this answer," I meant, if I'd like to pipe commands in an -exec, it doesn't seem like I can use your answer: compared to -execing a single command, piping commands in -exec seems like an entirely different beast. Commented Apr 27, 2022 at 19:18