1

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.

Thanks.

1
  • I think you need to mount followed by a copy
    – parapura rajkumar
    Jul 22, 2012 at 15:39

1 Answer 1

1
  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.

4
  • 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, 2012 at 17:31
  • Oh, I didn't see that. Edited my answer appropiately.
    – guelfi
    Jul 22, 2012 at 17:43
  • i guess filesystem is not mentioned here!! Jul 23, 2012 at 5:35
  • while cp its says... cp:ommitting directory .... it is omitting the directory i want to copy Jul 23, 2012 at 15:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .