Forrest logo
back to the fdisk tool

fdisk:tldr:42169

fdisk: Start the partition manipulator.
$ sudo fdisk ${-dev-sdX}
try on your machine

The sudo fdisk ${-dev-sdX} command is used to run the fdisk command with superuser privileges (sudo).

Here's a breakdown of the command:

  • sudo: The sudo command is used to execute subsequent commands with root or administrator privileges. It stands for "superuser do".

  • fdisk: The fdisk command is a utility in Unix-like operating systems used for disk partitioning. It allows you to create, delete, modify, and display partitions on a storage device.

  • ${-dev-sdX}: This part is a placeholder and should be replaced with the actual device identifier you want to operate on, like /dev/sda, /dev/sdb, etc. The $ sign indicates that it is a variable, and the curly braces {} enclose the variable. Replace X with the proper device letter of your device. For example, if you want to run fdisk on the /dev/sda device, the command would be sudo fdisk /dev/sda.

Keep in mind that running fdisk commands can have a significant impact on your disk, so be cautious and ensure you have a clear understanding of what you are doing before proceeding.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the fdisk tool