Skip to content

Instantly share code, notes, and snippets.

@Pelirrojo
Forked from vietdien2005/comand.sh
Last active January 22, 2020 22:17
Show Gist options
  • Save Pelirrojo/08518ff754718238d258dce78b64aaf2 to your computer and use it in GitHub Desktop.
Save Pelirrojo/08518ff754718238d258dce78b64aaf2 to your computer and use it in GitHub Desktop.
Bash Script to format an usb from CLI
#!/usr/bin/env bash
clear
diskutil --version >/dev/null 2>&1 || { echo >&2 "I require diskutil diskutil but it's not installed. Aborting."; exit 1; }
diskutil partitionDisk /dev/disk2 1 MBRFormat "MS-DOS FAT32" USB_NAME 805.30M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment