Sometimes it can be quite a challenge to find out what hardware you have but it is actually quite easy.
Here are a few commands and some sample output for you.
USB devices are usually easy to identify because you can just pick them up and look at them.
Below will help you out with the few that just say NoName on it. Often those noname ones are the same as the named ones just with another wrapping. Below display a list of detected USB devices.
# lsusb
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 0461:4d03 Primax Electronics, Ltd Kensington Mouse-in-a-box
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
The PCMCIA port is not that common anymore or at least not commonly used.
But this is how you list the detected PCMCIA devices. I dont have anything plugged in so this example might not hand you the big picture.
# lspcmcia
Socket 0 Bridge: [yenta_cardbus] (bus ID: 0000:00:08.0)
Below will display the loaded modules and what is using it. I cut away some of the entries to make it readable.
The output will differ on your system anyway.
# lsmod
Module Size Used by
binfmt_misc 7560 1
ipv6 235396 14
dm_snapshot 14340 0
dm_mirror 15136 0
dm_log 8452 1 dm_mirror
dm_mod 46216 3 dm_snapshot,dm_mirror,dm_log
i2c_dev 5256 0
eeprom 5232 0
…
The next one is a listing of the Hardware Abstraction Layer. I can actually be quite handy but you definently want to use grep with this one. It has a lot of output depending on how many HAL objects you have in the device database.
I did the lshal with no filters because I wanted to show what you can find here.
Try out something like "lshal |grep cdrom" on your systen to see what information you get.
# lshal
…
info.product = ‘IDE device (master)’ (string)
info.subsystem = ‘ide’ (string)
…
pci.product = ’65x/M650/740 PCI/AGP VGA Display Adapter’ (string)
pci.product_id = 25381 (0x6325) (int)
pci.subsys_product_id = 4127 (0x101f) (int)
pci.subsys_vendor = ‘Fujitsu Siemens Computers’ (string)
…
pci.vendor = ‘Silicon Integrated Systems [SiS]’ (string)
pci.vendor_id = 4153 (0x1039) (int)
Dumped 87 device(s) from the Global Device List.
————————————————
Yes I admit it. The next one is only included because of the fun of it. I guess it is only usable if you are in the shell already and what to see what you have in your DVD drive and dont want to bend down and eject your DVD..
I cut away some of the output here also. This will give a brief rapport on what is in your DVD drive.
# lsdvd
Disc Title: IP_MAN_DISC_1
Title: 01, Length: 00:00:21.140 Chapters: 03, Cells: 03, Audio streams: 01, Subpictures: 00
Title: 02, Length: 01:46:20.210 Chapters: 23, Cells: 24, Audio streams: 02, Subpictures: 01
…
Title: 17, Length: 00:01:38.040 Chapters: 01, Cells: 01, Audio streams: 01, Subpictures: 01
Title: 18, Length: 00:01:25.240 Chapters: 01, Cells: 01, Audio streams: 01, Subpictures: 01
Longest track: 02
The next one is one of the most useful ones. This will display the detected devices attached to the PCI bus to help you load the matching module.
# lspci
00:00.0 Host bridge: Silicon Integrated Systems [SiS] 650/M650 Host (rev 11)
00:01.0 PCI bridge: Silicon Integrated Systems [SiS] Virtual PCI-to-PCI bridge (AGP)
00:02.0 ISA bridge: Silicon Integrated Systems [SiS] SiS962 [MuTIOL Media IO] (rev 04)
00:02.1 SMBus: Silicon Integrated Systems [SiS] SiS961/2 SMBus Controller
00:02.3 FireWire (IEEE 1394): Silicon Integrated Systems [SiS] FireWire Controller
00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE]
00:02.6 Modem: Silicon Integrated Systems [SiS] AC’97 Modem Controller (rev a0)
00:02.7 Multimedia audio controller: Silicon Integrated Systems [SiS] AC’97 Sound Controller (rev a0)
00:03.0 USB Controller: Silicon Integrated Systems [SiS] USB 1.1 Controller (rev 0f)
00:03.1 USB Controller: Silicon Integrated Systems [SiS] USB 1.1 Controller (rev 0f)
00:03.2 USB Controller: Silicon Integrated Systems [SiS] USB 1.1 Controller (rev 0f)
00:03.3 USB Controller: Silicon Integrated Systems [SiS] USB 2.0 Controller
00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet (rev 91)
00:08.0 CardBus bridge: O2 Micro, Inc. OZ601/6912/711E0 CardBus/SmartCardBus Controller
01:00.0 VGA compatible controller: Silicon Integrated Systems [SiS] 65x/M650/740 PCI/AGP VGA Display Adapter
One way of using this could be as below.
# lspci |grep audio
00:02.7 Multimedia audio controller: Silicon Integrated Systems [SiS] AC’97 Sound Controller (rev a0)
The last one I will present is kind of off topic but it comes in handy now and then. It is in the "ls-family" so I might just as well sneak it in. This command will display all open files on your running host. At least all visible to you and me.
I do not show you a full listing with no filters because it is trivial and quite long. Instead Ill show you how I use it.
I am a big fan of Google and ofcourse I use Chrome on my Linux boxes. For the most part at least. If I want to know which files, which includes sockets as they also figure as files, I would do as below.
Here I also cut out some of the output. You will be surpriced when you learn how many file handles Chrome will open.
testbox:~# lsof |grep chrome
chrome 5335 root cwd DIR 3,1 4096 741889 /root
chrome 5335 root rtd DIR 3,1 4096 2 /
chrome 5335 root txt REG 3,1 34523900 81894 /opt/google/chrome/chrome
chrome 5335 root 7r FIFO 0,6 90387 pipe
chrome 5335 root 10u unix 0xdcbea480 91241 socket
chrome 5335 root 14w FIFO 0,6 91244 pipe
chrome 5335 root 15u 0000 0,7 0 13 anon_inode
chrome 5335 root 16u unix 0xda565280 91245 socket
chrome 5335 root 19w FIFO 0,6 91247 pipe
chrome 5335 root 20u 0000 0,7 0 13 anon_inode
chrome 5335 root 23u unix 0xda565680 91275 socket
chrome 5335 root 25r FIFO 0,6 91277 pipe
chrome 5335 root 27u unix 0xdcf1a900 91280 /root/.config/google-chrome/SingletonSocket
chrome 5335 root 28r CHR 1,9 1078 /dev/urandom
chrome 5335 root 31u REG 3,1 598016 763191 /root/.cache/google-chrome/Cache/data_0
chrome 5335 root 32u unix 0xdc678d80 91289 socket
chrome 5335 root 50u REG 3,1 0 242726 /var/tmp/etilqs_rJBsKMyT353qFkg (deleted)
chrome 5335 root 53u REG 3,1 9216 763171 /root/.pki/nssdb/cert9.db
chrome 5335 root 54u REG 3,1 11264 763172 /root/.pki/nssdb/key4.db
chrome 5335 root 55u unix 0xdcbea680 91938 socket
chrome 5335 root 58u REG 3,1 2048 243899 /var/tmp/etilqs_ThKaQy9AsxEIvQY (deleted)
chrome 5335 root 68ur REG 3,1 9895936 763180 /root/.config/google-chrome/Default/History Index 2010-01
chrome 5335 root 70u unix 0xdb1bcd80 91945 socket
chrome 5335 root 121uw REG 3,1 729088 763181 /root/.config/google-chrome/Default/History Index 2009-11
chrome 5335 root 126u REG 3,1 6704 763417 /root/.config/google-chrome/Default/History Index 2009-11-journal
chrome 5338 root cwd DIR 3,1 4096 741889 /root
chrome 5338 root rtd DIR 3,1 4096 2 /
chrome 5338 root txt REG 3,1 34523900 81894 /opt/google/chrome/chrome
chrome 5338 root 0r FIFO 0,6 8059 pipe
chrome 5338 root 2w REG 3,1 58944806 743133 /root/.xsession-errors
chrome 5338 root 6u unix 0xdcb70b80 90386 socket
chrome 5338 root 7r FIFO 0,6 90387 pipe
chrome 5340 root cwd DIR 3,1 0 792348 /tmp/chrome-sandbox-chroot-b8Y67N (deleted)
chrome 5340 root rtd DIR 3,1 0 792348 /tmp/chrome-sandbox-chroot-b8Y67N (deleted)
chrome 5340 root txt REG 3,1 34523900 81894 /opt/google/chrome/chrome
chrome 5340 root 0r FIFO 0,6 8059 pipe
chrome 5340 root 3u unix 0xdcf2c300 90389 socket
chrome 5340 root 4r FIFO 0,6 90410 pipe
chrome 5340 root 5u unix 0xdcf2cd00 90385 socket
chrome 5340 root 6u unix 0xdcaa7b00 90408 socket
chrome 5340 root 7u unix 0xdcf2c500 90390 socket
chrome 5340 root 8w FIFO 0,6 90410 pipe
chrome 5340 root 9r REG 3,1 1391223 82124 /opt/google/chrome/chrome.pak
chrome 5340 root 10r REG 3,1 132294 82087 /opt/google/chrome/locales/en-US.pak
chrome 5340 root 11r CHR 1,9 1078 /dev/urandom
chrome 5409 root cwd DIR 3,1 0 792348 /tmp/chrome-sandbox-chroot-b8Y67N (deleted)
chrome 5409 root 9r REG 3,1 1391223 82124 /opt/google/chrome/chrome.pak
chrome 5409 root 10r REG 3,1 132294 82087 /opt/google/chrome/locales/en-US.pak
chrome 5409 root 11r CHR 1,9 1078 /dev/urandom
chrome 5409 root 15u unix 0xdcb70780 91942 socket
chrome 5409 root 16r FIFO 0,6 91943 pipe
chrome 5409 root 17w FIFO 0,6 91943 pipe
chrome 5409 root 20u REG 0,16 262148 91403 /dev/shm/com.google.chrome.zdBQER (deleted)
chrome 5409 root 21u REG 0,16 8 91282 /dev/shm/com.google.chrome.MvCFoG (deleted)
Did you notice that Chrome actually use the /dev/urandom device?
I hope that this is somewhat useful to you.
Regards