← All commands
Topic hub System & Storage
Windows Linux System & Storage Command guide Disk Maintenance

Windows cipher /w free space equivalent in Linux

Zeros unused blocks on a supported unmounted filesystem.

Windows cipher /w free space
→
Linux equivalents
Debian/Ubuntu apt package: zerofree
sudo zerofree /dev/sdXn
Fedora dnf package: zerofree
sudo zerofree /dev/sdXn
Arch AUR/extra tool or use filesystem-native methods
sudo zerofree /dev/sdXn

Overview

What this command does

On Windows, "cipher /w free space" is used to zero free space. On Linux, the closest practical mapping shown here is "sudo zerofree /dev/sdXn". Zeros unused blocks on a supported unmounted filesystem. This reference is grouped under System & Storage → Disk Maintenance.

Migration tip: The Linux command "sudo zerofree /dev/sdXn" stays consistent across the compared distributions, but the package or base component can differ. Use the Debian/Ubuntu, Fedora or Arch row that matches the system you are administering.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows cipher /w free space maps to sudo zerofree /dev/sdXn for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.

Portable across the compared distros

The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.

Elevated privilege appears in this workflow

At least one example uses sudo. Confirm the target path, device, service or package before running the elevated form; do not add sudo simply to bypass an unexplained permission error.

Practical tasks

Common use cases

Zero free space

Zeros unused blocks on a supported unmounted filesystem.

sudo zerofree /dev/sdXn

Zero free space

sudo --help

Show command help when supported

man sudo

Open the manual page when installed

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

sudo zerofree /dev/sdXn

Walkthrough

Examples with explanations

# Windows equivalent: cipher /w free space
sudo zerofree /dev/sdXn

Reference

Common options and variations

Command or optionUse
sudo zerofree /dev/sdXnZero free space
sudo --helpShow command help when supported
man sudoOpen the manual page when installed

Distro differences

Debian/Ubuntu vs Fedora vs Arch

The command "sudo zerofree /dev/sdXn" is the same in all three rows, while package or base details differ: Debian/Ubuntu uses apt package: zerofree; Fedora uses dnf package: zerofree; Arch uses AUR/extra tool or use filesystem-native methods.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu apt package: zerofree sudo zerofree /dev/sdXn Same command on this distribution.
Fedora dnf package: zerofree sudo zerofree /dev/sdXn Same command on this distribution.
Arch AUR/extra tool or use filesystem-native methods sudo zerofree /dev/sdXn Same command on this distribution.

Keep learning

Related System & Storage commands