Skip to content

Disk path

disk-path shows disk usage for a path with df -h. It is one of the bundled functions you can use from a button as it is.

  • Runs: df -h {{.path}}
  • path (optional, default /): filesystem path to check

The function file

functions/disk-path.yaml
name: disk-path
run: "df -h {{.path}}"
params:
  - name: path
    type: string
    required: false
    default: "/"
    description: Filesystem path to check

Because path is optional and has a default, a button can leave it out and still work.

Use the default path or choose one

Disk usage buttons
- name: Disk (root)
  type: button
  function: disk-path        # no path field: uses the default "/"
- name: Disk (var)
  type: button
  function: disk-path
  path: "/var"

The first button runs df -h / and the second runs df -h /var.