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

Windows diskpart clean / clean all equivalent in Linux

Removes filesystem signatures from a disk or securely overwrites all data to prevent recovery.

Windows diskpart clean / clean all
→
Linux equivalents
Debian/Ubuntu same command
wipefs / shred
Fedora same command
wipefs / shred
Arch same command
wipefs / shred

Overview

What this command does

On Windows, "diskpart clean / clean all" is used to wipe or sanitise a disk. On Linux, the closest practical mapping shown here is "wipefs / shred". Removes filesystem signatures from a disk or securely overwrites all data to prevent recovery. This reference is grouped under System & Storage → Disk & Storage.

Migration tip: <code>wipefs</code> removes filesystem signatures quickly. <code>shred</code> overwrites data multiple times for a secure wipe. For SSDs, use the manufacturer's secure erase tool or <code>hdparm --security-erase</code>.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows diskpart clean / clean all maps to wipefs / shred 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.

Command-specific caution

shred is ineffective on SSDs and flash drives due to wear leveling — use the drive's built-in secure erase instead.

Practical tasks

Common use cases

Wipe or sanitise a disk

Removes filesystem signatures from a disk or securely overwrites all data to prevent recovery.

wipefs -a /dev/sdb

Remove filesystem signatures (fast)

shred -vzn 3 /dev/sdb

Secure 3-pass wipe

shred -u file.txt

Securely delete a single file

Ready to run

Copyable Linux commands

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

sudo wipefs -a /dev/sdb
sudo shred -vzn 3 /dev/sdb
shred -u sensitive_data.txt

Walkthrough

Examples with explanations

# Windows: diskpart → clean all

# Quick wipe (removes signatures only):
sudo wipefs -a /dev/sdb

# Secure 3-pass wipe:
sudo shred -vzn 3 /dev/sdb

# Securely delete a single file:
shred -u sensitive_data.txt

Reference

Common options and variations

Command or optionUse
wipefs -a /dev/sdbRemove filesystem signatures (fast)
shred -vzn 3 /dev/sdbSecure 3-pass wipe
shred -u file.txtSecurely delete a single file

Distro differences

Debian/Ubuntu vs Fedora vs Arch

Debian/Ubuntu, Fedora and Arch all use "wipefs / shred" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command wipefs / shred Same command on this distribution.
Fedora same command wipefs / shred Same command on this distribution.
Arch same command wipefs / shred Same command on this distribution.

Important

What to watch out for

shred is ineffective on SSDs and flash drives due to wear leveling — use the drive's built-in secure erase instead.

Keep learning

Related System & Storage commands