--- title: duf โ€” modern df date: 2026-10-18 time: 12:00 model: admin category: programs author_type: human summary: A df replacement tool that beautifully displays disk free space in a table. tags: program, Modern CLI Tools, duf --- **๐Ÿ’ฌ "duf command"** duf is a replacement for **the modern df** that shows disk free space in a pretty table. It displays usage and free space of mounted file systems. It outputs in a clean table without df's inconvenient line breaks. - **Concept**: Displays usage and free space of mounted file systems. - **Main Features**: Outputs in a clean table without df's inconvenient line breaks. - **Advantages**: Columns align neatly. - **Use Case**: Can view specific file systems only. ## Installation and Download duf can be installed via a package manager or the official script. | Environment | Command | | --- | --- | | Ubuntu / Debian | sudo apt install duf | | Fedora / RHEL | sudo dnf install duf | | Arch | sudo pacman -S duf | | macOS (brew) | brew install duf | | Go install | go install github.com/muesli/duf@latest | | Binary Download | github.com/muesli/duf/releases | Verify the installation with `duf --version`. ## Frequently Used Options | Option | Description | | --- | --- | | --all | Displays all file systems. | | --json | Outputs in JSON format. | | --sort size | Sorts by size. | | --filter | Filters specific mounts only. | | -x tmpfs | Excludes tmpfs. | ## Essential Command Combinations - `duf --all` โ€” Check all mount statuses. - `duf --sort size` โ€” View sorted by size. - `duf --json | jq` โ€” Output as JSON for use in scripts. **๐Ÿ’ฌ "Show me an example of using duf on an actual server"** Here is a step-by-step guide for situations commonly encountered on production servers. ### Step 1 ยท Verify Installation Check if it is installed. ``` duf --version || sudo apt install -y duf ``` ### Step 2 ยท Full Overview Check all mount statuses. ``` duf --all ``` ### Step 3 ยท Check Sorting View sorted by size. ``` duf --sort size ``` ## Actual Execution Output Here is the result of checking the server's mount status with duf. The table aligns cleanly. ![duf command execution result](https://games.aidebatehub.com/assets/duf-demo.png) Production server ## How It Is Used in Practice ### 1. Monitoring Script **Situation** โ€” Used in scripts that check disk space. ``` duf --json | jq -r '.[] | select(.size_bytes > 1000000000) | .mountpoint' ``` **Result** โ€” A list of large mount points is displayed. **Key Point** โ€” JSON output is convenient for script processing. ### 2. Specific Mounts Only **Situation** โ€” Check only NFS mounts. ``` duf nfs ``` **Result** โ€” Only NFS mount information is displayed. **Key Point** โ€” You can filter to view only the targets you need. ## Actual Execution Output This is the result sorted by size. ![duf command execution result 2](https://games.aidebatehub.com/assets/duf-demo2.png) Production server ## Points of Caution - Without root permissions, duf may not be able to see some mounts. - Inside containers, host mounts may not be visible correctly. - Since it shows the same information as df, it can be a direct replacement in existing monitoring scripts. - The --json output is useful when combined with jq in scripts. --- Source (HTML): https://games.aidebatehub.com/programs/linux/modern/duf.html This file is an auto-generated Markdown twin of the DevHub document.