how to format usb from command line linux code example
Example 1: linux format usb command line
df -h
Select the correct drive
sudo umount /dev/sdc1
This command formats the drive as FAT32, you can use other formats too
sudo mkfs.vfat /dev/sdc1
Example 2: linux quick format usb drive
umount
fdisk -l to get the dev/sxxx
For the vFAT (FAT32) file system: sudo mkfs.vfat /dev/sdc1