How to find out what Linux is using to control my hardware

userDepth

I want to find out what is Linux using to control my hardware. I guess modules and drivers and maybe they are the same.

I got this answer : How do I find out which driver a piece of hardware is using?

And there's a way to list the drivers but I also want to add an identifier to each list item.

If I run this command the this is what happens :

sudo lshw | grep -Eo 'driver=[^ ]+' | sort -u | cut -d\= -f2

agpgart-intel

ahci

ath9k

atl1c

ehci-pci

hub

i915

intel

lpc_ich

mei_me

pcieport

snd_hda_intel

tun

usb-storage

uvcvideo
Sergiy Kolodyazhnyy

If you are concerned with only filtering output of lshw to show device and its corresponding driver, you can use the lshw and awk combination bellow:

sudo lshw | awk '/product:/{  if(length(PROD) > 0){PROD=""};  for(i=1;i<=NF;i++) PROD=PROD" "$i  } /driver=/{  for(j=1;j<=NF;j++){ if($j~/driver=/) DRIVER=$j   };print "---",PROD,DRIVER; PROD=""}' 

Basic idea here is that we find lines that have "product: . . . " in them and store into PROD. Because some devices don't list drivers, we could have repeatedly appended line after line to PROD variable, so in the beginning we check length of the PROD string. Another matching that is going on, is for the lines containing the driver= part. Once we have that, we print both the product and the driver information.

Bellow is the command put together into a script, and sample output:

$ cat ./dev-drivers.sh                                                                                            
#!/bin/bash

sudo lshw | awk '/product:/{  if(length(PROD) > 0){PROD=""};\
            for(i=1;i<=NF;i++) PROD=PROD" "$i  }\
             /driver=/{  for(j=1;j<=NF;j++){ if($j~/driver=/) DRIVER=$j   };\
             print "---",PROD,DRIVER; PROD=""}' 

$ ./dev-drivers.sh                                                                                                
[sudo] password for xieerqi: 
---  product: ValleyView SSA-CUnit driver=iosf_mbi_pci
---  product: ValleyView Gen7 driver=i915
---  product: ValleyView 6-Port SATA AHCI Controller driver=ahci
---  product: ValleyView USB xHCI Host Controller driver=xhci_hcd
---  product: ValleyView SEC driver=mei_txe
---  product: ValleyView High Definition Audio Controller driver=snd_hda_intel
---  product: ValleyView PCI Express Root Port driver=pcieport
---  product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller driver=r8169
---  product: ValleyView PCI Express Root Port driver=pcieport
---  product: QCA9565 / AR9565 Wireless Network Adapter driver=ath9k
---  product: ValleyView PCI Express Root Port driver=pcieport
---  product: RTS5229 PCI Express Card Reader driver=rtsx_pci
---  product: ValleyView Power Control Unit driver=lpc_ich

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to find out what distros are using particular Linux version?

From Dev

How to find out what is launching a port scan in the night from my Linux?

From Java

How can I find out what projection my pre-projected GeoJSON is using?

From Dev

How can I find out what thread is using CPU in my android application

From Dev

How do I find out which version and derivative of Ubuntu is right for my hardware in terms of minimal system requirements?

From Dev

How do I find out which version and derivative of Ubuntu is right for my hardware in terms of minimal system requirements?

From Dev

Is there a way to find out what app is using most of my bandwidth in windows

From Dev

Linux: find out what process is using all the RAM?

From Dev

How do I find out my computer network name (Linux)?

From Dev

How to find out which service manager is installed on my Linux OS?

From Dev

How can I find my hardware details?

From Dev

How to find out xorg version? or "what's my xorg version?"

From Dev

How can I find out what motherboard is in my computer?

From Dev

How to find out what's wrong on all of my Qt programs?

From Dev

What is DEP, and how do I find out if my processor supports it?

From Dev

How do I find out what this unknown device is on my network?

From Dev

How can I find out what my default gateway should be?

From Dev

How can I find out what's wrong with my RAM?

From Dev

How to find out what is waking up my computer?

From Dev

How can I find out what this icon in my taskbar is?

From Dev

Crashed my server, how do I find out what happened?

From Dev

How to get Linux drivers for my (unsupported) hardware?

From Dev

How linux knows the name of my hardware?

From Dev

How can I find the hardware model in Linux?

From Dev

How can I find the hardware model in Linux?

From Dev

Find out what is causing add/remove hardware sound

From Dev

How do I find out what a linux command does exactly?

From Dev

How to find out what linux capabilities a process requires to work?

From Dev

How to know what hardware works well with linux?

Related Related

  1. 1

    How to find out what distros are using particular Linux version?

  2. 2

    How to find out what is launching a port scan in the night from my Linux?

  3. 3

    How can I find out what projection my pre-projected GeoJSON is using?

  4. 4

    How can I find out what thread is using CPU in my android application

  5. 5

    How do I find out which version and derivative of Ubuntu is right for my hardware in terms of minimal system requirements?

  6. 6

    How do I find out which version and derivative of Ubuntu is right for my hardware in terms of minimal system requirements?

  7. 7

    Is there a way to find out what app is using most of my bandwidth in windows

  8. 8

    Linux: find out what process is using all the RAM?

  9. 9

    How do I find out my computer network name (Linux)?

  10. 10

    How to find out which service manager is installed on my Linux OS?

  11. 11

    How can I find my hardware details?

  12. 12

    How to find out xorg version? or "what's my xorg version?"

  13. 13

    How can I find out what motherboard is in my computer?

  14. 14

    How to find out what's wrong on all of my Qt programs?

  15. 15

    What is DEP, and how do I find out if my processor supports it?

  16. 16

    How do I find out what this unknown device is on my network?

  17. 17

    How can I find out what my default gateway should be?

  18. 18

    How can I find out what's wrong with my RAM?

  19. 19

    How to find out what is waking up my computer?

  20. 20

    How can I find out what this icon in my taskbar is?

  21. 21

    Crashed my server, how do I find out what happened?

  22. 22

    How to get Linux drivers for my (unsupported) hardware?

  23. 23

    How linux knows the name of my hardware?

  24. 24

    How can I find the hardware model in Linux?

  25. 25

    How can I find the hardware model in Linux?

  26. 26

    Find out what is causing add/remove hardware sound

  27. 27

    How do I find out what a linux command does exactly?

  28. 28

    How to find out what linux capabilities a process requires to work?

  29. 29

    How to know what hardware works well with linux?

HotTag

Archive