Windows diskpart clean / clean all equivalent in Linux
Removes filesystem signatures from a disk or securely overwrites all data to prevent recovery.
diskpart clean / clean all
wipefs / shred
wipefs / shred
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.
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.
For the broader concept behind this mapping, read Linux disks, storage and mounts.
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 option | Use |
|---|---|
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 |
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.
| Distribution | Package manager / base | Equivalent command | Difference 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
Keep learning