home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] how to use udevadm to print *just* KERNEL and SUBSYSTEM?

  • Subject: Re: [OCLUG-Tech] how to use udevadm to print *just* KERNEL and SUBSYSTEM?
  • From: Rob Echlin <rob [ at ] echlin [ dot ] ca>
  • Date: Sat, 16 Mar 2013 16:37:19 -0700 (PDT)
Hi Rob
Taking the simple method, this works for me:

udevadm info -a -p $(udevadm info -q path -n /dev/tty3) | grep -e KERNEL -e SUBSYSTEM


Signed,
Captain Obvious!
<g>

 
--
Rob Echlin, B. Eng.
613-266-8311 -  Ottawa, ON
http://talksoftware.wordpress.com  - http://picasaweb.google.com/coderoller



>________________________________
> From: Robert P. J. Day <rpjday [ at ] crashcourse [ dot ] ca>
>To: Ottawa Linux Users Group <linux [ at ] lists [ dot ] oclug [ dot ] on [ dot ] ca> 
>Sent: Saturday, March 16, 2013 1:41:17 PM
>Subject: [OCLUG-Tech] how to use udevadm to print *just* KERNEL and SUBSYSTEM?
> 
>
>  currently writing a tutorial on udev and i'm drawing a blank on
>something that should be simple -- what variation of udevadm can i use
>to print just the KERNEL and SUBSYSTEM values corresponding to a
>device?
>
>  here's the tutorial:
>
>http://www.crashcourse.ca/wiki/index.php/Udev
>
>it's still *very* incomplete but, partway down, you can see how to do
>an attribute walk on (in my case, using the example of a usb-serial
>cable) /dev/ttyUSB0:
>
>$ udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0)
>
>that command generates a pile of output, and what i care about is at
>the very beginning:
>
>  looking at device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0/ttyUSB0/tty/ttyUSB0':
>    KERNEL=="ttyUSB0"
>    SUBSYSTEM=="tty"
>    DRIVER==""
>
>all i want are the values of KERNEL and SUBSYSTEM since it's those
>values that are used by the rules file that's eventually consulted. so
>for the sake of brevity, i want to figure out what command and options
>will print just that, and i just can't find it.
>
>  am i missing something obvious?
>
>rday
>
>-- 
>
>========================================================================
>Robert P. J. Day                                 Ottawa, Ontario, CANADA
>                        http://crashcourse.ca
>
>Twitter:                                      http://twitter.com/rpjday
>LinkedIn:                              http://ca.linkedin.com/in/rpjday
>========================================================================
>_______________________________________________
>Linux mailing list
>Linux [ at ] lists [ dot ] oclug [ dot ] on [ dot ] ca
>http://oclug.on.ca/mailman/listinfo/linux
>
>
>