# Format2USB - Quick Way to Format USB/HDD/SDCards via Commandline A couple of functions i created to format my drives. It will delete existing partitions and create just a single partitions that fills the whole drive, then formats it to whatever filesystem you choose. I could of used just mkfs to format but from my experience linux likes to have at least one partition so that is why we used fdisk to create a partition before we format with mkfs. * tutorial video: [Link](https://www.youtube.com/watch?v=7txO1cdNJsQ) * offical website: [Link](https://www.youtube.com/user/gotbletu) ### install requirements mkfs fdisk ### code add to ~/.bashrc or ~/.zshrc #-------- Color Code {{{ #------------------------------------------------------ # LINK: https://wiki.archlinux.org/index.php?title=Bash/Prompt_customization&oldid=419076#List_of_colors_for_prompt_and_Bash # Reset Color_Off='\e[0m' # Text Reset # Regular Colors Black='\e[0;30m' # Black Red='\e[0;31m' # Red Green='\e[0;32m' # Green Yellow='\e[0;33m' # Yellow Blue='\e[0;34m' # Blue Purple='\e[0;35m' # Purple Cyan='\e[0;36m' # Cyan White='\e[0;37m' # White # }}} #-------- Format USB Stick/HDD/SDCards {{{ #------------------------------------------------------ # Format USB Stick/Hard Drive # It will create a single partition that fills the whole drive space format2usb-ext2() { if [ $# -lt 2 ]; then echo -e "format and create a partition that fills up the whole device" echo -e "\nUsage: $0