简体   繁体   English

我需要找到如何区分USB已连接和读卡器也已连接到Linux中的目标

[英]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.

相关问题 如何列出在USB大容量存储模式下通过电话连接到Linux的SD卡的内容? - How can I list the contents of an SD card connected to Linux via a phone in USB Mass Storage Mode? 我可以读取与 USB 卡读写器连接的 SD 卡序列号作为挂载的 sda 吗? - Can I read SD card serial number connected with USB card reader/writer as mounted sda? 如何查找在 Linux (Ubuntu) 中连接的所有 USB 设备? - How to find all USB devices connected in Linux (Ubuntu)? 在Linux下读取连接到USB-SD读取器的SD卡的CID - Read CID of SDcard connected to USB-SD Reader under Linux 在Linux上通过Java程序检测PCSC时出现问题,读卡器已连接 - Issue detecting PCSCvia java program on linux, the card reader is connected PCSC不会在linux上返回任何内容,读卡器已连接 - PCSC does not return anything on linux, the card reader is connected 在linux中如何配置连接到usb的调制解调器? - How to configure the modem connected to usb in linux? 找出是否连接了USB设备。 Linux中的Ruby - Find out if USB device is connected. Ruby in Linux 如何将音频文件播放到任何已连接的USB音频卡? - How I can play any audiofile to any connected usb audio card? 在 Linux 中启动“init”进程之前,如何确保已连接的 USB 设备被枚举? - How do I make sure that a connected USB device gets enumerated before starting "init" process in Linux?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM