Find the answer to your Linux question:
Results 1 to 6 of 6
Hi How do I copy e.g. a zip file from a memory stick/usb in Linux? Regards Tebogo...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    4

    [SOLVED] Copy from a memory stick/usb


    Hi

    How do I copy e.g. a zip file from a memory stick/usb in Linux?

    Regards
    Tebogo

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Welcome to the forums!

    You can take the harder route and copy from the command line, or you can do it the easier way by using any GUI file manager and simply right-click on the item to be copied, choose copy, then navigate to the where you want it and paste it there, or you can drag it there.
    oz

  3. #3
    Just Joined!
    Join Date
    Sep 2009
    Posts
    4
    OZ
    Let me re-phrase my question. I need a Linux command to copy a zip file from a memory stick/usb.

    Tebogo

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    Hi Tebogo,

    you need to know if / where your memory stick is mounted

    BTW: You need root access to view /var/log/messages and to mount a device.

    When you attach a usb device you should see something similar to this in /var/log/messages:

    Code:
    Sep 16 10:12:23 dev kernel: usb 1-1: new high speed USB device using ehci_hcd and address 2
    Sep 16 10:12:23 dev kernel: usb 1-1: configuration #1 chosen from 1 choice
    Sep 16 10:12:23 dev kernel: Initializing USB Mass Storage driver...
    Sep 16 10:12:23 dev kernel: scsi1 : SCSI emulation for USB Mass Storage devices
    Sep 16 10:12:23 dev kernel: usbcore: registered new driver usb-storage
    Sep 16 10:12:23 dev kernel: USB Mass Storage support registered.
    Sep 16 10:12:28 dev kernel:   Vendor: Crucial   Model: Gizmo! JR.        Rev: 0.00
    Sep 16 10:12:28 dev kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
    Sep 16 10:12:28 dev kernel: SCSI device sdb: 8060927 512-byte hdwr sectors (4127 MB)
    Sep 16 10:12:28 dev kernel: sdb: Write Protect is off
    Sep 16 10:12:28 dev kernel: sdb: assuming drive cache: write through
    Sep 16 10:12:28 dev kernel: SCSI device sdb: 8060927 512-byte hdwr sectors (4127 MB)
    Sep 16 10:12:28 dev kernel: sdb: Write Protect is off
    Sep 16 10:12:28 dev kernel: sdb: assuming drive cache: write through
    Sep 16 10:12:28 dev kernel:  sdb: sdb1
    Sep 16 10:12:28 dev kernel: sd 1:0:0:0: Attached scsi removable disk sdb
    Sep 16 10:12:28 dev kernel: sd 1:0:0:0: Attached scsi generic sg1 type 0
    That tells you that the usb device was attached to the system as device sdb

    fdisk -l will also show the attached drives:

    Code:
    fdisk -l
    
    Disk /dev/sda: 17.1 GB, 17179869184 bytes
    255 heads, 63 sectors/track, 2088 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          13      104391   83  Linux
    /dev/sda2              14        2088    16667437+  8e  Linux LVM
    
    Disk /dev/sdb: 4127 MB, 4127194624 bytes
    255 heads, 63 sectors/track, 501 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1         502     4030432    b  W95 FAT32Partition 1 has different physical/logical endings:
         phys=(500, 254, 63) logical=(501, 196, 14)
    You need to mount the device before you can use it though

    Code:
    mkdir /mnt/usb
    mount /dev/sdb1 /mnt/usb
    (mkdir is only required if you don't have a directory to mount the device to)

    Once that's done, normal *nix commands can be used

    Code:
    cp /mnt/usb/<my file> ~/.
    for example.

    When your done, unmount the device

    Code:
    umount /dev/sdb1
    or

    Code:
    umount /mnt/usb
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  6. #5
    Just Joined!
    Join Date
    Sep 2009
    Posts
    4
    Thanks a mil, got it.

  7. #6
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    No worries
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •