zfs-list8
List properties of zfs datasets
Usage
zfs list
[{-r | -d
depth}]
[-Hp]
[-j
[--json-int]]
[-o
property
[,property]
…]
[-s
property]
…
[-S
property]
…
[-t
type
[,type]
…]
[{filesystem | volume | snapshot}]
…
Overview
If specified, you can list property information by the absolute pathname or the relative pathname. By default, all file systems and volumes are displayed. Snapshots are displayed if the listsnapshots pool property is on (the default is off), or if the -t snapshot or -t all options are specified. The following fields are displayed: name, used, available, referenced, mountpoint.
-
-H -
Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary white space.
-
-j, --json [--json-int] -
Print the output in JSON format. Specify
--json-intto print the numbers in integer format instead of strings in JSON output. -
-d depth -
Recursively display any children of the dataset, limiting the recursion to depth. A depth of
1will display only the dataset and its direct children. -
-o property -
A comma-separated list of properties to display. The property must be:
-
One of the properties described in the Native Properties section of zfsprops(7)
-
A user property
-
The value
nameto display the dataset name -
The value
spaceto display space usage properties on file systems and volumes. This is a shortcut for specifying-oname,avail,used,usedsnap,usedds,usedrefreserv,usedchild-tfilesystem,volume.
-
-
-p -
Display numbers in parsable (exact) values.
-
-r -
Recursively display any children of the dataset on the command line.
-
-s property -
A property for sorting the output by column in ascending order based on the value of the property. The property must be one of the properties described in the Properties section of zfsprops(7) or the value
nameto sort by the dataset name. Multiple properties can be specified at one time using multiple-sproperty options. Multiple-soptions are evaluated from left to right in decreasing order of importance. The following is a list of sorting criteria:-
Numeric types sort in numeric order.
-
String types sort in alphabetical order.
-
Types inappropriate for a row sort that row to the literal bottom, regardless of the specified ordering.
If no sorting options are specified the existing behavior of
zfslistis preserved.
-
-
-S property -
Same as
-s, but sorts by property in descending order. -
-t type -
A comma-separated list of types to display, where type is one of
filesystem,snapshot,volume,bookmark, orall. For example, specifying-tsnapshotdisplays only snapshots.fs,snap, orvolcan be used as aliases forfilesystem,snapshot, orvolume.
Examples
Example 1 : No Listing ZFS Datasets
The following command lists all active file systems and volumes in the system. Snapshots are displayed if listsnaps=on. The default is off. See zpoolprops(7) for more information on pool properties.
# zfs list NAME USED AVAIL REFER MOUNTPOINT pool 450K 457G 18K /pool pool/home 315K 457G 21K /export/home pool/home/anne 18K 457G 18K /export/home/anne pool/home/bob 276K 457G 276K /export/home/bob
Example 2 : No Listing ZFS filesystems and snapshots in JSON format
# zfs list -j -t filesystem,snapshot | jq
{
"output_version": {
"command": "zfs list",
"vers_major": 0,
"vers_minor": 1
},
"datasets": {
"pool": {
"name": "pool",
"type": "FILESYSTEM",
"pool": "pool",
"properties": {
"used": {
"value": "290K",
"source": {
"type": "NONE",
"data": "-"
}
},
"available": {
"value": "30.5G",
"source": {
"type": "NONE",
"data": "-"
}
},
"referenced": {
"value": "24K",
"source": {
"type": "NONE",
"data": "-"
}
},
"mountpoint": {
"value": "/pool",
"source": {
"type": "DEFAULT",
"data": "-"
}
}
}
},
"pool/home": {
"name": "pool/home",
"type": "FILESYSTEM",
"pool": "pool",
"properties": {
"used": {
"value": "48K",
"source": {
"type": "NONE",
"data": "-"
}
},
"available": {
"value": "30.5G",
"source": {
"type": "NONE",
"data": "-"
}
},
"referenced": {
"value": "24K",
"source": {
"type": "NONE",
"data": "-"
}
},
"mountpoint": {
"value": "/mnt/home",
"source": {
"type": "LOCAL",
"data": "-"
}
}
}
},
"pool/home/bob": {
"name": "pool/home/bob",
"type": "FILESYSTEM",
"pool": "pool",
"properties": {
"used": {
"value": "24K",
"source": {
"type": "NONE",
"data": "-"
}
},
"available": {
"value": "30.5G",
"source": {
"type": "NONE",
"data": "-"
}
},
"referenced": {
"value": "24K",
"source": {
"type": "NONE",
"data": "-"
}
},
"mountpoint": {
"value": "/mnt/home/bob",
"source": {
"type": "INHERITED",
"data": "pool/home"
}
}
}
},
"pool/home/bob@v1": {
"name": "pool/home/bob@v1",
"type": "SNAPSHOT",
"pool": "pool",
"dataset": "pool/home/bob",
"snapshot_name": "v1",
"properties": {
"used": {
"value": "0B",
"source": {
"type": "NONE",
"data": "-"
}
},
"available": {
"value": "-",
"source": {
"type": "NONE",
"data": "-"
}
},
"referenced": {
"value": "24K",
"source": {
"type": "NONE",
"data": "-"
}
},
"mountpoint": {
"value": "-",
"source": {
"type": "NONE",
"data": "-"
}
}
}
}
}
}
Releases
3 releases since Debian 11 (Bullseye); the text changed 2 times.
--json since Debian 13 (Trixie);
-j since Debian 13 (Trixie).