3

I need to create a file in Ubuntu to use a USB cradle to upload Cycling data. I found instructions using google but am unable to create a file using touch.

Any help would be appreciated. This is the direction I am trying to follow: Create a file /etc/udev/rules/powertap.rules containing the following line:

SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6001", MODE="666", GROUP="plugdev"
2
  • sudo touch /etc/udev/rules/powertap.rules [sudo] password for "username": touch: cannot touch `/etc/udev/rules/powertap.rules': No such file or directory – Peter Schriver Nov 5 '12 at 15:41
  • FWIW my USB port gives a permission error. I used "sudo usermod -G dialout user" to fix this problem but it also removed my username as root so I could sudo – Peter Schriver Nov 5 '12 at 15:48
1

If typing cd /etc/udev/rules results in

bash: cd: /etc/udev/rules: No such file or directory 

Then you are missing that directory and you need to create it first using

sudo mkdir /etc/udev/rules

After that use one of the other posted suggestions such as:

sudo echo "SYSFS{idVendor}==\"0403\", SYSFS{idProduct}==\"6001\", MODE=\"666\", GROUP=\"plugdev\"" > /etc/udev/rules/powertap.rules
1
  • Thanks for the help. I sort of figured this out but appreciate the imput – Peter Schriver Nov 5 '12 at 22:00
1

Touch merely changes file timestamps. It does create a file but you can do it using gedit and be able to edit it. Touch doesn't edit file contents.

This may work :

touch ~/powertap.rules; cat>>SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6001", MODE="666", GROUP="plugdev"; sudo cp ~/powertap.rules /etc/udev/rules/powertap.rules

1
  • touch ~/powertap.rules; cat>>SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6001", MODE="666", GROUP="plugdev"; sudo cp ~/powertap.rules /etc/udev/rules/powertap.rules cat: SYSFS{idProduct}==6001,: No such file or directory cat: MODE=666,: No such file or directory cat: GROUP=plugdev: No such file or directory – Peter Schriver Nov 5 '12 at 16:21
1

The following command will create that file

sudo echo "SYSFS{idVendor}==\"0403\", SYSFS{idProduct}==\"6001\", MODE=\"666\", GROUP=\"plugdev\"" > /etc/udev/rules.d/powertap.rules

touch its mostly usefull to create an empty file. Remember that you can always open gedit as sudo, put that line and save the file.

Sam

7
  • Thanks for the quick reply. It still doesn't look like I made a file? sudo echo "SYSFS{idVendor}==\"0403\", SYSFS{idProduct}==\"6001\", MODE=\"666\", GROUP=\"plugdev\"" > /etc/udev/rules/powertap.rules bash: /etc/udev/rules/powertap.rules: No such file or directory – Peter Schriver Nov 5 '12 at 15:58
  • This command should work. Does the directory exist? can you cd /etc/udev/rules – coteyr Nov 5 '12 at 16:03
  • cd /etc/udev/rules bash: cd: /etc/udev/rules: No such file or directory – Peter Schriver Nov 5 '12 at 16:11
  • there is a file /etc/udev/rules.d. Is this where I should place the file. Please forgive my lack of knowledge – Peter Schriver Nov 5 '12 at 16:15
  • Forgot about the problem of spaces. If any problems persist follow Sam's suggestion and use sudo gedit. Its less hassle. – VedVals Nov 5 '12 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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