Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

new Linux user here (Ubuntu 12.04)... I've been looking on google and found some scripts that would make what I'm about to ask easier but what I would like to do is write a script that automatically opens terminal and runs the command 'easytether connect' when I connect my phone to the computer... Is there any way to do this?

share|improve this question
Did you try Googling for udev rules? Lots of tutorials. – ubfan1 Oct 7 '13 at 2:47
  1. Check the udev attributes for target device (if you know it). Example:

    udevadm info -a -n /dev/ttyACM0

    Or monitor udev events (then plug your device):

    udevadm monitor --environment --udev
  2. Use specific attributes to match target device and Create new udev rules file in /etc/udev/rules.d/. Use ACTION=="add" to match device added event and RUN+="..." to run needed script. Example

    ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth0", RUN+="/usr/bin/ethtool -s eth0 wol d"


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.