← All commands
Topic hub System & Storage
Windows Linux System & Storage 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

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

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

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

This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.

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