12

cd: /run/user/$UID/gvfs/mtp://%5Busb%3A001,010%5D/

gives the error :

cd: no such file or directory: /run/user/1000/gvfs/mtp://%5Busb%3A001,010%5D/ 

Even though the device is mounted in the file manager and shows the same mtp path

I'd like to access it via terminal to able to copy data out of it as the File Manager just hangs when done via the GUI.

Distribution : Fedora 28

GAD3R
  • 63,407
  • 31
  • 131
  • 192
DevX136
  • 121
  • 1
  • 1
  • 8

3 Answers3

7

cd to /run/user/$UID/gvfs, run ls. You'll find the directory within there, without the %5B / %3A / %5D encodings.

Or just cd to it without the encodings

cd '/run/user/1000/gvfs/[usb:001,010]'
steve
  • 21,582
  • 5
  • 48
  • 75
  • 8
    there is no directory there, `ls` returns empty – DevX136 Aug 25 '18 at 16:12
  • This answer isn't correct anymore, my `gvfs` directory is empty (Ubuntu 22) 21:38:45 with raleigh in /run/user/1000/gvfs at Z390-AORUS-PRO-WIFI ➜ ls -lah total 0 drwx------ 2 raleigh raleigh 40 Oct 18 10:12 . drwx------ 18 raleigh raleigh 560 Oct 18 15:13 .. – Raleigh L. Oct 19 '22 at 04:39
  • find the user id using "id" command – Talespin_Kit Mar 25 '23 at 04:56
2

On Debian 11 (Sid) with GNOME, I could browse the Android device in a graphical file manager but couldn't find the files anywhere using the terminal.

After I installed the gvfs-fuse package and rebooted, my Android device, when plugged, also became available in /run/user/1000/gvfs/mtp\:host\=Name_of_my_device/.

At last, I could use rsync!

slm
  • 363,520
  • 117
  • 767
  • 871
learner
  • 151
  • 4
1

In my system I found that the gio command (from glib2 package) can be used to explore and operate on mtp mount URIs.

For example:

gio mount -l

will list all the known mountpoints locations

gio list 'mtp://%5Busb%3A001,010%5D/'

will list the top level files at the that mount location path

gio open 'mtp://%5Busb%3A001,010%5D/DCIM/Photo01.png'

will open the specified location with the corresponding mime handler defined in your system

Other file interactions commands that resemble shell commands exist: remove, copy, move and so on. See man gio(1) for detailed explanation for each command or type the command gio help to see a list of them with short explanation.

elig
  • 561
  • 1
  • 6
  • 13