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
  • 1
    You could use find's -printf option to avoid invoking a separate process (or several, depending on the number of files). See my answer for an example. Commented Apr 1, 2014 at 23:53
  • 1
    Knowing that there are other ways to do it, I wanted to give stat a chance and show -exec ... +. Really! Sometimes I think, stat deserves more attention... and noone should take recipes from here without reading about the ingredients and thinking about consequences... Commented Apr 2, 2014 at 4:43
  • Btw... not every find has -printf... Commented Apr 2, 2014 at 4:49
  • 1
    @yeti - If your find doesn't have -printf, you can use -exec sh -c 'printf...' to get much of the same functionality. That would include access to $(pwd) for fully qualified paths as well. Commented Apr 2, 2014 at 6:00
  • 2
    I met lots of linux users never having read about stat. So sometimes I just want to direct some attention on stat... I think stat deserves it... Commented Apr 2, 2014 at 6:06