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 tutorial 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
[1] 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.]