動作環境
CentOS 6.8 (64bit)
/dev/ttyUSB0
の情報を見ようとしていた。
以下を見つけた。
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を利用したトリガ動作の使用例について教えていただきました。
情報感謝です。