How to copy a file to a pendrive in Ubuntu terminal [duplicate]

What is the command to copy a file to a pendrive in Ubuntu terminal?


When you insert your pendrive, it is automatically opened in the GUI. Press Ctrl+L in the file manager window to see the path where your pendrive is actually mounted (it will be usually /media/username/label where username is your username, and label is the label given to your pendrive when it was formatted). In the terminal, just copy files to this path using cp command: cp filename.txt /media/username/label.