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

I got an LG2 phone and I am running Xubuntu 15.10.

This is how I mounted the device to mnt directory in under my user.

  1. First make sure you have the following packages installed in your system.

    sudo apt-get install jmtpfs mtp-tools
    
  2. Connect your phone as MTP device and type the following command in your terminal.

    mtp-detect
    
  3. Uncomment user_allow_other in file /etc/fuse.conf.

  4. Create a directory mnt in your home directory.

    mkdir mnt
    
  5. Mount the device.

    jmtpfs ~/mnt
    
  6. Thats it. Now your device is mounted under the mnt directory created in step 4.

Note: There may be some steps that are unnecessary. But following the above steps worked for me.

Reference: https://wiki.archlinux.org/index.php/MTP