# Duf | Disk Usage/Free Utility (Linux, BSD, macOS & Windows)

**URL:** <https://onehack.st/t/duf-disk-usage-free-utility-linux-bsd-macos-windows/171036>\
**Category:** Tools & Scripts\
**Tags:** tools, windows, file-management\
**Created:** [January 27, 2021, 11:10am UTC](https://onehack.st/t/duf-disk-usage-free-utility-linux-bsd-macos-windows/171036 "2021-01-27T11:10:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheStrength](https://onehack.st/user_avatar/onehack.st/thestrength/32/46753_2.png) [@TheStrength](https://onehack.st/u/TheStrength)\
**Post date:** [January 27, 2021, 11:10am UTC](https://onehack.st/t/duf-disk-usage-free-utility-linux-bsd-macos-windows/171036/1 "2021-01-27T11:10:40Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/e/5/e50ec848135fd7ed039778ffd61251606ea3634e.png)

Disk Usage/Free Utility (Linux, BSD, macOS & Windows)

**Features**

- User-friendly, colorful output
- Adjusts to your terminal’s width
- Sort the results according to your needs
- Groups & filters devices
- Can conveniently output JSON

**Installation**

**Packages**

**Linux**

- Arch Linux: [duf](https://aur.archlinux.org/packages/duf/)
- Nix: `nix-env -iA nixpkgs.duf`
- [Packages](https://github.com/muesli/duf/releases) in Alpine, Debian & RPM formats

**BSD**

- FreeBSD: `pkg install duf`

**macOS**

- with [Homebrew](https://brew.sh/): `brew install duf`
- with [MacPorts](https://www.macports.org/): `sudo port selfupdate && sudo port install duf`

**Windows**

- with [scoop](https://scoop.sh/): `scoop install duf`

**Android**

- Android (via termux): `pkg install duf`

**Binaries**

- [Binaries](https://github.com/muesli/duf/releases) for Linux, FreeBSD, OpenBSD, macOS, Windows

**From source**

Make sure you have a working Go environment (Go 1.12 or higher is required). See the [install instructions](https://golang.org/doc/install.html).

Compiling duf is easy, simply run:

```auto
git clone https://github.com/muesli/duf.gitcd dufgo build

```

**Usage**

You can simply start duf without any command-line arguments:

```auto
duf

```

If you supply arguments, duf will only list specific devices & mount points:

```auto
duf /home /some/file

```

If you want to list everything (including pseudo, duplicate, inaccessible file systems):

```auto
duf --all

```

You can show and hide specific tables:

```auto
duf --only local,network,fuse,special,loops,bindsduf --hide local,network,fuse,special,loops,binds

```

You can also show and hide specific filesystems:

```auto
duf --only-fs tmpfs,vfatduf --hide-fs tmpfs,vfat

```

Sort the output:

```auto
duf --sort size

```

Valid keys are: `mountpoint`, `size`, `used`, `avail`, `usage`, `inodes`, `inodes_used`, `inodes_avail`, `inodes_usage`, `type`, `filesystem`.

Show or hide specific columns:

```auto
duf --output mountpoint,size,usage

```

Valid keys are: `mountpoint`, `size`, `used`, `avail`, `usage`, `inodes`, `inodes_used`, `inodes_avail`, `inodes_usage`, `type`, `filesystem`.

List inode information instead of block usage:

```auto
duf --inodes

```

If duf doesn’t detect your terminal’s colors correctly, you can set a theme:

```auto
duf --theme light

```

If you prefer your output as JSON:

```auto
duf --json

```

**Troubleshooting**

Users of `oh-my-zsh` should be aware that it already defines an alias called `duf`, which you will have to remove in order to use `duf`:

```auto
unalias duf

```

## GitHub:

> **[GitHub - muesli/duf: Disk Usage/Free Utility - a better 'df'...](https://github.com/muesli/duf)**
>
> Disk Usage/Free Utility - a better 'df' alternative
