Copy files to and from Android phone in terminal

Maybe this is answered already, I'm not quite sure what to search for. I have tried, but so far I found nothing that's directly related to my issue:

I have an Android phone, a Nexus 6P. I plug it to my computer, select the ”Transfer files” option in my phone and I open Thunar. There it is and I can access all my files and copy them back and forth, so no problem in that aspect. However, the address to the phone in Thunar's address field is ”mtp://Huawei_Nexus_6P_xxx” (the ”xxx” seems to be the same random looking alphanumerics every time).

My problem is that I want to write a script that copies a certain file from my computer to the phone, and for that I want the address to the phone to be the same every time, just to keep things simple.

Is this possible to use the ”mtp://” address above in a script or terminal? Do I need to install anything? What? I already have mtpfs installed (probably a part of the system; I don't remember installing it), can I use that for this? How?

Right after I wrote this I found the answer… in Thunar…

Phone=Huawei_Nexus_6P_xxx
cd /run/user/${UID}/gvfs/mtp:host=${Phone}

When I found my horrible mistake I tried to delete the thread, but obviously I'm not authorised. Anyone who is, feel free to delete this crap of a thread. Or maybe someone could create a new category called ”Idiot's corner” and put it there…

2 Likes

There is no horrible or stupid questions - only horrible or stupid answers.

Glad you found the solution - and thank you for sharing it.

The whole purpose of the community - sharing and seeking knowledge :+1:

Personally - I sometimes use the forum post to explain and describe my issue and sometimes in the process - I stumble over the answer or the response helps me see things from another angle - which is the entire purpose of the forum - educating and sharing knowledge in relation to Manjaro and the world of GNU/Linux.

4 Likes

I totally agree with @linux-aarhus. What I don't see is the problem and the solution. What is wrong and what is right? You said you saw this one line, what is wrong with is, or is this the correct line? Please explain.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by