I don't know whether you already know about this. You may even feel this post as silly, but yet this will help some newbies in Ubuntu.
To format your pendrive or any removable disk, you don't have to use any shell commands. Just select from the taskbar
Places -> Computer -> Right click the (pendrive or removable disk) and select Format.
You can select the file system according to your usage. If you are just going to use it under Linux, select "EXT" file system or choose "FAT" file system.