[英]I need to find how to differentiate between usb is connected and card reader is also connected to target in linux
I have searched many commands but those are not working i want a command which will detect my usb and card reader and tell me that for example sda is usb and sdc is card reader what i have used is 我搜索了许多命令,但是那些命令不起作用,我想要一个可以检测到我的USB和读卡器并告诉我的命令,例如sda是usb和sdc是读卡器,我使用的是
OUTPUT 输出值
$(lsblk -l -o name | grep sd | head -n 1)
cat /sys/block/$OUTPUT/device/{vendor,model}
but this will only giving me usb name. 但这只会给我USB名称。 I want some logic which will give me that sda is usb and sdb is card readers (using shell scripting) please help me for this thanks in advance.
我想要一些逻辑,这些逻辑将使我知道sda是usb,而sdb是读卡器(使用shell脚本),请提前帮助我。
You can try 你可以试试
lsblk -dno name,subsystems
and see if your card reader is differentiate. 并查看您的读卡器是否与众不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.