The mkfs
command in C Shell (csh) is used to create a filesystem on a specified device. This command formats the device and prepares it for use, allowing you to store files and directories on it.
The basic syntax of the mkfs
command is as follows:
mkfs [options] [arguments]
-t
: Specify the type of filesystem to create (e.g., ext4, vfat).-L
: Set a label for the filesystem.-V
: Enable verbose output to see detailed progress and actions.-n
: Create a filesystem without writing to the device (dry run).Here are some practical examples of using the mkfs
command:
mkfs -t ext4 /dev/sdb1
mkfs -t vfat -L MY_USB /dev/sdc1
mkfs -t ext3 -V /dev/sdd1
mkfs -n -t ext4 /dev/sde1
mkfs
, as it will erase existing data on the device.-n
option for a dry run to verify your command before executing it.lsblk
or fdisk -l
to list devices.