List macOS disks and APFS containers
Build a paste-ready command, then review its compatibility and effects before running it.
read-onlyno known side effects Compatibility
macOSVerified for macOS using zsh, bash syntax.
Operational knowledgereview due 2027-01-20
Requirementsdiskutildiskutil must be installed and available on PATH.
Version supportdiskutil Current supported releasesVerified for macos using zsh, bash syntax; consult compatibility notes for platform-specific differences.
Expected signals/dev/disk0 (internal, physical):Representative successful output; values vary with the selected target and system state.
Known errorsdiskutil: command not founddiskutil is missing or is not available on PATH.
Verifydiskutil listThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01diskutilCommandRuns the diskutil stage of this one-liner.
02listArgumentPasses list to diskutil.
Example input
diskutil list
Example output
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.3 GB disk0
1: Apple_APFS_ISC Container disk1 524.3 MB disk0s1
2: Apple_APFS Container disk3 494.4 GB disk0s2
Illustrative output — exact values vary by system and data.
Official sources