System and processes

The mkfs command

Creates a filesystem on a device (format). With -t you choose the type.

Syntax

sudo mkfs -t <tipo> <dispositivo>Try it in the terminal →

Copy-ready examples

$ sudo mkfs.ext4 /dev/sdb1Format as ext4

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Formatting erases all data on the device.

Related commands

FAQ

What does mkfs do?

It creates a filesystem on a device or partition, ready to be mounted.

Does it erase data?

Yes: it formats the device, so it wipes all its content.

More System and processes commands

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course