zfs list -d
By user12625760 on Apr 14, 2009
I've just pushed the changes for zfs list that give it a -d option to limit the depth to which recursive listings will go. This is of most use when you wish to list the snapshots of a given data set and only the snapshots of that data set.
Before this you could achieve this using a short pipe line which while it produced the correct results was horribly inefficient and very slow for datasets that had lots of descendents.
: v4u-1000c-gmp03.eu TS 6 $; zfs list -t snapshot rpool | grep '\^rpool@' rpool@spam 0 - 64K - rpool@two 0 - 64K - : v4u-1000c-gmp03.eu TS 7 $; zfs list -d 1 -t snapshot NAME USED AVAIL REFER MOUNTPOINT rpool@spam 0 - 64K - rpool@two 0 - 64K - : v4u-1000c-gmp03.eu TS 8 $;
It will allow the zfs-snapshot service to be much more efficient when it needs to list snapshots. The change will be in build 113.