find lacks the option -printf, now what?

前端 未结 5 1474
旧巷少年郎
旧巷少年郎 2020-11-27 15:56

I have not found a reason why Mac\'s find does not have the option -printf. Apple normally decides to take options out which are not orthogonal to the other commands?

<
5条回答
  •  眼角桃花
    2020-11-27 16:39

    Alternatively, you could just

    find . -type f -exec stat -f "%z %N" {} \;
    

    Granted, this isn't how you would do the same thing on linux, but works for MacOS

    find . -type f -exec stat -c "%s %N" {} \;
    

    produces similar (not same, but close) output on linux.

提交回复
热议问题