Detecting a phone when connected by USB(ubuntu 16.04) How can I detect a device independent USB insert eventMounting USB disks automatically (How it works)Adding files to a cell phone connected via USBSystem claims my USB is mounted when I insert it and I cannot (un)mount it. How do I fix this?Suspending fails when a USB mouse is connectedUSB only detected when connected to internetLinux Mint - Not detecting monitor connected via USB-C to HDMI hubExternal displays not detected when connected through USB-C hubUSB MIDI device crashes when connected to second deviceCan i use smartphone tethering instead of USB wireless inthernet lan card in Linux?Fedora 28 USB phone mount troubles

Multi tool use
Multi tool use

aging parents with no investments

Manga about a female worker who got dragged into another world together with this high school girl and she was just told she's not needed anymore

How to answer pointed "are you quitting" questioning when I don't want them to suspect

Copycat chess is back

I see my dog run

Crop image to path created in TikZ?

What is the command to reset a PC without deleting any files

Why do we use polarized capacitors?

Why airport relocation isn't done gradually?

Can the Produce Flame cantrip be used to grapple, or as an unarmed strike, in the right circumstances?

Why was the "bread communication" in the arena of Catching Fire left out in the movie?

Are objects structures and/or vice versa?

Finding files for which a command fails

Denied boarding due to overcrowding, Sparpreis ticket. What are my rights?

Prime joint compound before latex paint?

How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?

Add an angle to a sphere

Shall I use personal or official e-mail account when registering to external websites for work purpose?

Is Social Media Science Fiction?

Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?

Why doesn't a const reference extend the life of a temporary object passed via a function?

How to make particles emit from certain parts of a 3D object?

Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?

Is it wise to focus on putting odd beats on left when playing double bass drums?



Detecting a phone when connected by USB


(ubuntu 16.04) How can I detect a device independent USB insert eventMounting USB disks automatically (How it works)Adding files to a cell phone connected via USBSystem claims my USB is mounted when I insert it and I cannot (un)mount it. How do I fix this?Suspending fails when a USB mouse is connectedUSB only detected when connected to internetLinux Mint - Not detecting monitor connected via USB-C to HDMI hubExternal displays not detected when connected through USB-C hubUSB MIDI device crashes when connected to second deviceCan i use smartphone tethering instead of USB wireless inthernet lan card in Linux?Fedora 28 USB phone mount troubles






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm writing a bash script to synchronize pictures in my phone with my PC. What I need is to



  • detect if the phone is connected to a USB port

  • which port is used, and then

  • access it.

I'm not connecting my phone via USB tethering.
The code that I already have it's this:



tmp=`gio mount -l -i | grep activation_root`
mount_point=$tmp//activation_root=/
gio mount $mount_point
cp /run/user/1000/gvfs/*/*/DCIM/Camera/*.jpg ~/Test`


With this I'm getting the device and mounting it, but I'm hardcoded the path used in the cp command. I need a way to obtain that path through a command or a way to use the command gio copy for this situation.










share|improve this question









New contributor




Gerardo Martínez Rodríguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • You may find unix.stackexchange.com/questions/315216/… useful

    – K7AAY
    Apr 5 at 17:06






  • 1





    Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.

    – Shadur
    2 days ago

















1















I'm writing a bash script to synchronize pictures in my phone with my PC. What I need is to



  • detect if the phone is connected to a USB port

  • which port is used, and then

  • access it.

I'm not connecting my phone via USB tethering.
The code that I already have it's this:



tmp=`gio mount -l -i | grep activation_root`
mount_point=$tmp//activation_root=/
gio mount $mount_point
cp /run/user/1000/gvfs/*/*/DCIM/Camera/*.jpg ~/Test`


With this I'm getting the device and mounting it, but I'm hardcoded the path used in the cp command. I need a way to obtain that path through a command or a way to use the command gio copy for this situation.










share|improve this question









New contributor




Gerardo Martínez Rodríguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • You may find unix.stackexchange.com/questions/315216/… useful

    – K7AAY
    Apr 5 at 17:06






  • 1





    Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.

    – Shadur
    2 days ago













1












1








1








I'm writing a bash script to synchronize pictures in my phone with my PC. What I need is to



  • detect if the phone is connected to a USB port

  • which port is used, and then

  • access it.

I'm not connecting my phone via USB tethering.
The code that I already have it's this:



tmp=`gio mount -l -i | grep activation_root`
mount_point=$tmp//activation_root=/
gio mount $mount_point
cp /run/user/1000/gvfs/*/*/DCIM/Camera/*.jpg ~/Test`


With this I'm getting the device and mounting it, but I'm hardcoded the path used in the cp command. I need a way to obtain that path through a command or a way to use the command gio copy for this situation.










share|improve this question









New contributor




Gerardo Martínez Rodríguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm writing a bash script to synchronize pictures in my phone with my PC. What I need is to



  • detect if the phone is connected to a USB port

  • which port is used, and then

  • access it.

I'm not connecting my phone via USB tethering.
The code that I already have it's this:



tmp=`gio mount -l -i | grep activation_root`
mount_point=$tmp//activation_root=/
gio mount $mount_point
cp /run/user/1000/gvfs/*/*/DCIM/Camera/*.jpg ~/Test`


With this I'm getting the device and mounting it, but I'm hardcoded the path used in the cp command. I need a way to obtain that path through a command or a way to use the command gio copy for this situation.







linux bash usb smartphone






share|improve this question









New contributor




Gerardo Martínez Rodríguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Gerardo Martínez Rodríguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 14 hours ago







Gerardo Martínez Rodríguez













New contributor




Gerardo Martínez Rodríguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 5 at 16:18









Gerardo Martínez RodríguezGerardo Martínez Rodríguez

112




112




New contributor




Gerardo Martínez Rodríguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Gerardo Martínez Rodríguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Gerardo Martínez Rodríguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • You may find unix.stackexchange.com/questions/315216/… useful

    – K7AAY
    Apr 5 at 17:06






  • 1





    Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.

    – Shadur
    2 days ago

















  • You may find unix.stackexchange.com/questions/315216/… useful

    – K7AAY
    Apr 5 at 17:06






  • 1





    Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.

    – Shadur
    2 days ago
















You may find unix.stackexchange.com/questions/315216/… useful

– K7AAY
Apr 5 at 17:06





You may find unix.stackexchange.com/questions/315216/… useful

– K7AAY
Apr 5 at 17:06




1




1





Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.

– Shadur
2 days ago





Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.

– Shadur
2 days ago










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Gerardo Martínez Rodríguez is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510752%2fdetecting-a-phone-when-connected-by-usb%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Gerardo Martínez Rodríguez is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















Gerardo Martínez Rodríguez is a new contributor. Be nice, and check out our Code of Conduct.












Gerardo Martínez Rodríguez is a new contributor. Be nice, and check out our Code of Conduct.











Gerardo Martínez Rodríguez is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510752%2fdetecting-a-phone-when-connected-by-usb%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







I7Bjgb QQ wuPw k,3R8p fTbVJ GG2bV28i
gS74kOg2Cdwtb IZWjhydvkgwydix

Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

NetworkManager fails with “Could not find source connection”Trouble connecting to VPN using network-manager, while command line worksHow can I be notified about state changes to a VPN adapterBacktrack 5 R3 - Refuses to connect to VPNFeed all traffic through OpenVPN for a specific network namespace onlyRun daemon on startup in Debian once openvpn connection establishedpfsense tcp connection between openvpn and lan is brokenInternet connection problem with web browsers onlyWhy does NetworkManager explicitly support tun/tap devices?Browser issues with VPNTwo IP addresses assigned to the same network card - OpenVPN issues?Cannot connect to WiFi with nmcli, although secrets are provided

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.