oreilly.comSafari Books Online.Conferences.


Linux in a Nutshell

This directory of Linux commands is from Linux in a Nutshell, 5th Edition.

Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.

Buy it now, or read it online on Safari Bookshelf.


cfdisk [options] [device]

System administration command. Partition a hard disk using a full-screen display. Normally, device will be /dev/hda, /dev/hdb, /dev/sda, /dev/sdb, /dev/hdc, /dev/hdd, and so on; the default is the first device on the system. See also fdisk.



Use an arrow on the left side to highlight the currently selected partition, instead of reverse video.

-c cylinders

Specify the number of cylinders to use to format the specified device.


Ignore driver-provided geometry; guess one instead.

-h heads

Specify the number of heads to use to format the specified device.

-s sectors

Specify the number of sectors per track to use to format the specified device.


Print version number and exit.


Do not read the partition table; partition from scratch.

-P format

Display the partition table in format, which must be r (raw data), s (sector order), or t (table format). See the manpage for the meaning of the fields in the raw format, which shows what will be written by cfdisk for each partition. The sector format shows information about the sectors used by each partition. The table format shows the starting and ending head, sector, and cylinder for each partition.


up arrow, down arrow

Move among partitions.

left arrow, right arrow

Move among commands at the bottom of the screen.

Enter key

Select currently highlighted command or value.


Toggle flag indicating whether selected partition is bootable.


Delete partition (allow other partitions to use its space).


Alter the disk's geometry. Prompt for what to change: cylinders, heads, or sectors (c, h, or s, respectively).




Attempt to ensure maximum usage of disk space in the partition.


Create a new partition. Prompt for more information.


Print the partition table to a file. Possible formats are the same as for the -P option.


Quit without saving information.


Prompt for a new filesystem type, and change to that type.


Change the partition-size units. The choice of units rotates from megabytes to sectors to cylinders and back.


Save information. Must be uppercase, to prevent accidental writing.

Linux Resources
  • Linux Online
  • The Linux FAQ
  • Linux Kernel Archives
  • Kernel Traffic

  • Sponsored by: