LoginSignup
0
0

More than 5 years have passed since last update.

udev > udevadmによるデバイス情報の表示 > udevadm info --attribute-walk -n /dev/ttyUSB0 | udevを利用したトリガ動作の使用例

Last updated at Posted at 2018-01-22
動作環境
CentOS 6.8 (64bit)

/dev/ttyUSB0の情報を見ようとしていた。
以下を見つけた。

99-usb-serial.rules @ GitHub

udevadm info --attribute-walk -n /dev/ttyUSB0 |grep serial (can be used to get serial number)

上記のコマンドを元に以下を実行すると/dev/ttyUSB0に関する情報を見ることができた。

$udevadm info --attribute-walk -n /dev/ttyUSB0

それぞれのオプションは何を意味するのか。

-n

-n--nameの省略記号なのだろう。

--name=file
           The name of the device node or a symlink to query

--attribute-walk

--attribute-walk
           Print all sysfs properties of the specified device that can be used in udev rules to match the specified
           device. It prints all devices along the chain, up to the root of sysfs that can be used in udev rules.

よく分かっていない。

このオプションを指定しない場合は以下となった。

$ udevadm info -n /dev/ttyUSB0
missing option

@tukiyo3 さんによるGamepadを一般ユーザで使う
では-aとして指定しているようだ。

備考

lsのmanでは-a, --allのように短縮形とともに記載がある。
自分が見ているudevadmのmanでは短縮形の記載がないもよう。オプション数が少ないudevadmの場合は、頭文字1文字を使った短縮形でのオプション指定が使えるのかもしれない。

教えていただいた事項

@tukiyo3 さんのコメントにてudevを利用したトリガ動作の使用例について教えていただきました。

情報感謝です。

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0