Where are MTP mounted devices located in the filesystem?
As you have already found out, the mountpoints are in /run/user/$USER/gvfs/
(or /var/run/user/$UID/gvfs
) and are named after the protocol, connection type and address they use. Which makes things more difficult, because the connection address may change every time you replug the device, even if it is the same port. If you have the same device twice it gets even worse.
You can use lsusb
to display all connected USB devices from terminal:
$ lsusb | grep Google # Note: This is a Nexus 4, change accordingly
Bus 002 Device 025: ID 18d1:4ee2 Google Inc.
As you have noticed Nautilus also gives this information via tool tip. You will find the encoded form of e.g. mtp://[usb:002,025]
in /run/user/$USER/gvfs
(or /var/run/user/$UID/gvfs
) as mtp:host=%5Busb%3A002%2C025%5D
Asker's edit: This seems to require a newer version of libmtp and/or gvfs than is available per default in 13.04. Run sudo add-apt-repository ppa:langdalepl/gvfs-mtp
and update before doing anything else.
Edit: PPA not needed anymore in saucy/13.10 and newer, filenames are listed in terminal as they are in Nautilus.
Edit 2016-01-11: I removed the script that was previously included in this answer due to lack of time for maintenance and improvements. You can still find it in the revision history.
My Nexus device's memory can be accessed at:
/run/user/$UID/gvfs/mtp*
So if your $UID is 1000
, you may find it by either doing
$ cd /run/user/$UID/gvfs/mtp*
or (for the exact location in an example assuming your UID is 1000),
$ cd /run/user/1000/gvfs/mtp\:host=%5Busb%3A001%2C006%5D/
MTP
mounted device usually can be found in : /run/user/1000/gvfs/
for eg if your Nautilus address bar shows mtp://[usb:001,006]/
, then you can access by:
/run/user/1000/gvfs/mtp\:host=%5Busb%3A001%2C006%5D/
now on terminal you can copy files or folders:
- cd into folder ->
cd /run/user/1000/gvfs/mtp\:host=%5Busb%3A001%2C006%5D/
- then copy required folders to current directory ->
cp -r ~/videos/ .