Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here I wanted to ask that how to copy files from my usb pen drive to my linux box if my system is entirely in CLI text based with no graphical interface?

I have some Linux packages to install. I downloaded it and now i have to install it in my Linux machine (in VM) which is in CLI.


share|improve this question

migrated from Jul 22 '12 at 15:43

This question came from our site for professional and enthusiast programmers.

I think you need to mount followed by a copy – parapura rajkumar Jul 22 '12 at 15:39
  1. Allow the virtualized system to directly access the USB ports. How you do that depends on the software you use for virtualization.

  2. Mount the usb drive somewhere in your file system, for example, under /mnt:

    # mount /dev/sdXY /mnt

    Here, sdXY specifies the number of the disk / partition of the usb drive. The first disk (which is probably your hard disk) is named sda, the second is sdb and so one. The following number is the partition on this disk, so sda3 is the third partition on the first disk. If you only have one hard disk, the device file of the usb drive should be /dev/sdb1.

  3. Copy the files from /mnt to wherever you want them:

    # cp /mnt/foo /bar

    If you want to copy whole directories, you also need to pass the -r (recursive) flag to cp:

    # cp -r /mnt/directory /bar

Alternatively, you can also copy the files to a network share on the host system and access them from the guest, but this probably requires more work.

share|improve this answer
The questioner is saying his linux is running in a VM. Before mounting it is neccessary to allow using USB ports inside the VM. How to do this is depending on the VM software. – guenter Jul 22 '12 at 17:31
Oh, I didn't see that. Edited my answer appropiately. – guelfi Jul 22 '12 at 17:43
i guess filesystem is not mentioned here!! – Meghraj Jul 23 '12 at 5:35
while cp its says... cp:ommitting directory .... it is omitting the directory i want to copy – Meghraj Jul 23 '12 at 15:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.