cfdisk
disk managementlinux
The cfdisk command is one of the most frequently used commands in Linux/Unix-like operating systems. cfdisk Display or manipulate a disk partition table with a curses interface
Quick Reference
Command Name:
cfdisk
Category:
disk management
Platform:
linux
Basic Usage:
cfdisk [options] [arguments]
Common Use Cases
Syntax
cfdisk [options] [device]
Options
Option | Description |
---|---|
-h, --help | Display help text and exit |
-V, --version | Display version information and exit |
-L, --color[=when] | Colorize output (auto, always, or never) |
-r, --read-only | Open device in read-only mode |
-s, --sector-size size | Specify sector size of the device |
-z, --zero | Start with an empty partition table |
--label type | Specify the partition table type (dos, gpt, etc.) |
Examples
How to Use These Examples
The examples below show common ways to use the cfdisk
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
#
# Start cfdisk for a specific device with partition table display
cfdisk /dev/nvme0n1Basic Examples:
# Launch cfdisk for the first disk cfdisk /dev/sda
Advanced Examples:
# Force creation of a new DOS partition table cfdisk --zero /dev/sdd