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*

5
  • -name takes a basic glob pattern as argument, not a regexp. Some find implementations have a -regex predicate, but it matches on the full path, not just the name and the default regexp flavour and how to switch to another and which varies with the implementation. Commented Aug 31 at 17:41
  • -maxdepth 0 means it will only work on . itself which obviously does match the pattern Commented Aug 31 at 17:41
  • xargs -0 -r without argument will call echo. Commented Aug 31 at 17:42
  • -t / --target-directory is a GNU extension. Commented Aug 31 at 17:42
  • No point in using -print0 | xargs -r0 when you can use -exec. Commented Aug 31 at 17:43