Is diskutil the command line tool on Mac an open source program?

I've been searching high and low for this program's source code on opensource.apple.com, but cannot locate it for 10.13.6. Is there a way to get its source?

  • No it is not open source so the code is not available. What makes you think it is open source especially after not finding it in opensource.apple.com
    – mmmmmm
    Commented Aug 12, 2021 at 11:17
  • 3
    This seems like a XY problem. If you find the source, what will you do with it?
    – lhf
    Commented Aug 12, 2021 at 11:22
  • 2
    BSD has a diskutil command, on which Apple's is likely to be based. That is open source, but it won't have Apple's secret sauce for HFS and APFS.
    – benwiggy
    Commented Aug 12, 2021 at 11:42
  • @benwiggy the BSD version should be good enough. How do I obtain BSD code for diskutil? Searched for it on google but can't seem to find. Apologies I am not familiar with BSD pls pardon. Commented Aug 13, 2021 at 4:30

1 Answer 1


You already know that the open source code in macOS is here Apple Open Source. A significant section is the XNU kernel (some of it). There are also some libraries and utilities.

I am sure you are disappointed by the (lack of) breadth of what is available.

Specifically for diskutil, it is not there.

There is nowhere else that Apple publishes open source.

Most of macOS is not open source.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .