Solaris ZFS Administration Guide

Scripting ZFS Storage Pool Output

The default output for the zpool list command is designed for readability, and is not easy to use as part of a shell script. To aid programmatic uses of the command, the -H option can be used to suppress the column headings and separate fields by tabs, rather than by spaces. For example, to request a simple list of all pool names on the system:


# zpool list -Ho name
tank
dozer

Here is another example:


# zpool list -H -o name,size
tank   80.0G
dozer  1.2T