LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-28-2010, 11:41 AM   #1
eeguy02
LQ Newbie
 
Registered: Apr 2007
Posts: 2

Rep: Reputation: 0
Usb drive, how to locate it, how to move folder from Usb drive to usr directory


hi

I want to move a folder from USB drive to desktop, any directory, let say usr directory. But don't know what the name for usb drive and where to find it, i know i am going to use mv command. Please give me instruction on how to do this, thanks
 
Old 02-28-2010, 11:47 AM   #2
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 66
Your USB device will be /dev/sd[b,c,d,...] (depending on how many other drives you have). Some systems (like those with Gnome) automatically mount your USB drive to something like /media/DEVICENAME (depending on the usb drive's name, id number). If you need to mount it manually, you can do:
Code:
sudo mount /dev/sdb /mnt
(where sdb is the usb drive). After that, you can do:
Code:
mv /mnt/somedir $HOME/Desktop
Keep in mind, mv will put the file/dir in the new location and delete it from the old location. cp will make a copy.
 
Old 02-28-2010, 12:25 PM   #3
eeguy02
LQ Newbie
 
Registered: Apr 2007
Posts: 2

Original Poster
Rep: Reputation: 0
thanks

when i do lsusb this is what i have

Bus 005 Device 002: ID 0781:5406 sandisk corp 4Gb flash drive

and some other below that with different ID, so how do I know this drive is sd(b,c,or d)

thanks

Last edited by eeguy02; 02-28-2010 at 01:09 PM. Reason: more text adding
 
Old 02-28-2010, 01:45 PM   #4
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 66
Well, if you only have one hard drive in your computer, it's probably going to be sdb, and depending on whether or not you have it partitioned, it might be sdb1 sdb2, etc. You might be able to get a definitive answer by checking the output of
Code:
ls -l /dev/disk/by-id
 
Old 02-28-2010, 10:49 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
If you know the UUID of the file system the folder is on then you can mount the file system:
Code:
mount /dev/disk/by-uuid/<the UUID> /<some mount directory>
for example
Code:
mount /dev/disk/by-uuid/efa8a079-ab80-41c9-b018-85810dd3c45d /mnt
.
You can find out the UUID by examining the links in /dev/disk/by-uuid/ and then plugging in the USB HDD; a new link should appear pointing to the /dev/s[a-][1-] device that has just been created.
 
Old 02-28-2010, 11:23 PM   #6
rhadmn
Member
 
Registered: Oct 2009
Location: Bangalore
Distribution: Redhat Linux, Solaris, CentOS
Posts: 32

Rep: Reputation: 1
Usb drive, how to locate it, how to move folder from Usb drive to usr directory

Hi,

Just use the below command to know ur new USB-HDD media connected.


# fdisk -l


The above command will give the output of all the Usb-Hdd media connected to the particular Host.


You can just examine the drives and confirm the respective drive and mount it if it is not already mounted.

After that use the below command to copy the particular dir from Usb-Hdd to ur Desktop.


# cp -r /mnt/<dir> $HOME/Desktop [this cmd will copy the directory]

# mv /mnt/<dir> $HOME/Desktop [this cmd will move ie cut and paste the directory]


Please let me know if u r not clear.

Regards,
rhadmn
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB flash drive folder not appearing chris24300 Linux - Newbie 7 08-20-2009 03:26 PM
Can't move files from usb flash drive WillingToLikeLinux Ubuntu 1 07-05-2009 08:30 PM
Installing Debian on USB Hard Drive/USB Jump Drive kushalkoolwal Debian 10 02-26-2009 01:46 PM
please someone help me.. to locate my USB external hard drive haryoh Linux - Software 2 10-14-2005 10:20 AM
Mandrake Move 2.0 doesn't seem to find my USB flash drive Jeff59 Linux - Hardware 0 01-24-2005 07:21 PM


All times are GMT -5. The time now is 07:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration