List APFS containers and volumes
Build a paste-ready command, then review its compatibility and effects before running it.
diskutil apfs list | head -40read-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 signalsAPFS Containers (1 found)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 apfs list | head -40The 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.
02apfsArgumentPasses apfs to diskutil.
03listArgumentPasses list to diskutil.
04|PipelinePasses the output on the left to the command on the right.
05headCommandRuns the head stage of this one-liner.
06-40OptionConfigures head with the -40 option.
Example input
diskutil apfs list | head -40
Example output
APFS Containers (1 found)
|
+-- Container disk3 5C8E8E22-6A5C-4D71-88F2-9B79F0B2AC31
Capacity Ceiling (Size): 494384795648 B (494.4 GB)
Capacity In Use By Volumes: 284114001920 B (284.1 GB)
Illustrative output — exact values vary by system and data.
Official sources