Many times it happens that your pen drive or memory cards does not formatted from file manager so you have to format it from terminal. In this tutorial, it is shown that how to format pen drive or any other hard-disk or memory card from terminal using commands in Ubuntu.
This video gives you a complete idea of how to format pen drive from terminal and which commands you have to type.
I also attached the screenshots of this commands from terminal window step by step.
 First of all type the below command for know the name of your pen
drive or memory card. [here | (pipe) operator is used which is given
above your enter key in most of keyboards.]
dmesg | tail
 Then unmount your pen drive using the following command.
sudo umount /dev/sdb1
And enter your password.
 Then enter the following command to format your pen drive with
sudo mkfs.vfat -n 'Ubuntu' -I /dev/sdb1
Your pen drive is now formatted and ready to use.