Linux: How to find your serial (any connected) device?

31 Mar 2014

In Linux all devices that are connected to the system are listed in/dev If you connect your mouse to your system it will detect it as hidraw. Other serial devices will be named as tty0, tty1,etc. So if you connect a serial (any) device and you want to know it’s name ( for ex: you want to connect it via minicom ), first go to /dev using

cd /dev

Then list the contents of folder using ls But it will be hard to figure out the name of your device from the long list. So here is a trick for it. Disconnect the device and type this in terminal.

ls > removed.txt 

Connect your device again and type

ls >connected.txt 

Your device’s name will be on the connected.txt file. But how to know filter it? Compare both list and the odd one will be your device. Type this.

diff removed.txt connected.txt  

You will get the name of your device.




Comments