zfs(8)
Manage ZFS filesystems, volumes, snapshots, and storage pools.
Synopsis
zfs SUBCOMMAND [OPTIONS] [ARGUMENTS]Description
zfs is the primary command for administering ZFS datasets, including filesystems, volumes, snapshots, and clones. It allows you to create, destroy, list, and modify ZFS storage objects and their properties.
ZFS is a combined filesystem and logical volume manager that provides advanced features like copy-on-write, snapshots, compression, deduplication, and RAID-like protection (via vdev redundancy managed by zpool).
Common subcommands include: create, destroy, list, get, set, snapshot, clone, send, receive, mount, and unmount.
Common options
| Flag | What it does |
|---|---|
-r | Recursively apply operation to all child datasets |
-p | Print exact numeric values (no unit suffixes) |
-H | Omit headers and use tab delimiters in output |
-o property | Specify which properties to display or set |
-s property | Sort output by the specified property |
-d depth | Limit recursion depth for list operations |
Examples
List all ZFS datasets with basic information (name, used, available, mountpoint)
zfs listCreate a new filesystem named 'data' as a child of the 'tank' pool
zfs create tank/dataRecursively display compression ratio for tank and all child datasets
zfs get -r compressratio tankEnable LZ4 compression on the tank/data filesystem
zfs set compression=lz4 tank/dataRecursively create snapshots of tank and all children with tag 'backup-2024'
zfs snapshot -r tank@backup-2024Create a writable clone of the snapshot at tank/restore
zfs clone tank@backup-2024 tank/restoreStream a snapshot to another pool for backup or replication
zfs send tank@snap1 | zfs receive backup/tankRecursively delete the tank/data filesystem and all its snapshots/children
zfs destroy -r tank/data