Hi
How do I copy e.g. a zip file from a memory stick/usb in Linux?
Regards
Tebogo
Printable View
Hi
How do I copy e.g. a zip file from a memory stick/usb in Linux?
Regards
Tebogo
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
Let me re-phrase my question. I need a Linux command to copy a zip file from a memory stick/usb.
Tebogo
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:
That tells you that the usb device was attached to the system as device sdbCode: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
fdisk -l will also show the attached drives:
You need to mount the device before you can use it thoughCode: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)
(mkdir is only required if you don't have a directory to mount the device to)Code:mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb
Once that's done, normal *nix commands can be used
for example.Code:cp /mnt/usb/<my file> ~/.
When your done, unmount the device
orCode:umount /dev/sdb1
Code:umount /mnt/usb
Thanks a mil, got it.
No worries ;)