1 00:00:00,000 --> 00:00:10,500 On Linux there are different commands that can be used for listing and identifying hardware 2 00:00:10,500 --> 00:00:11,500 components. 3 00:00:11,500 --> 00:00:14,620 In this video we'll have a look at them. 4 00:00:14,620 --> 00:00:19,139 So regardless of the state of the driver, Linux will always list devices. 5 00:00:19,139 --> 00:00:24,600 The fact that you can see a device doesn't mean that Linux addresses it the right way. 6 00:00:24,600 --> 00:00:29,980 If the appropriate driver is available, additional device information can be revealed. 7 00:00:29,980 --> 00:00:33,599 The best way to find out is by using lspci-k. 8 00:00:33,599 --> 00:00:38,740 That will scan for devices and drivers on the PCI bus, and if a driver was found, you'll 9 00:00:38,740 --> 00:00:41,380 see the name of the driver. 10 00:00:41,380 --> 00:00:47,099 There are some generic utilities to find out more about your hardware, and also utilities 11 00:00:47,099 --> 00:00:50,779 that refer to specific device subsystems. 12 00:00:50,779 --> 00:00:56,820 So let's have a look at the generic utilities, like lsdev, which is listing devices, lsusb, 13 00:00:56,820 --> 00:01:02,580 which is listing devices on the USB bus, and lspci, which is about the PCI bus. 14 00:01:02,580 --> 00:01:06,660 lsblk is also a part of the ls family. 15 00:01:06,660 --> 00:01:08,660 It will list block devices. 16 00:01:08,660 --> 00:01:14,980 lscpu, you probably guessed it, is listing your CPUs and their properties. 17 00:01:14,980 --> 00:01:22,019 And dmessage can be convenient to get information about device initialization. 18 00:01:22,019 --> 00:01:24,519 Let's check out these commands. 19 00:01:24,519 --> 00:01:30,360 So lsusb is listing what is on the USB bus. 20 00:01:30,360 --> 00:01:34,199 And there we can see all the different devices on the USB bus. 21 00:01:34,199 --> 00:01:40,440 So I can see it's all VMware, and there's a mouse interface and a keyboard interface. 22 00:01:40,440 --> 00:01:43,760 The most useful of them is lspci. 23 00:01:43,760 --> 00:01:47,199 Lspci is listing devices on the PCI bus. 24 00:01:47,199 --> 00:01:54,040 It's not very exciting in a virtual machine, but nevertheless, if you use lspci-k, look 25 00:01:54,040 --> 00:01:55,800 for the kernel modules. 26 00:01:55,800 --> 00:02:01,199 This is identifying the kernel module that is in use for a specific PCI device, which 27 00:02:01,199 --> 00:02:06,680 is showing you whether or not the PCI devices are doing all right. 28 00:02:06,680 --> 00:02:10,160 lsblk is for listing block devices. 29 00:02:10,160 --> 00:02:18,240 So here I can see that I have two block devices, SR0 and NVMe0 and 1, where SR0 is my optical 30 00:02:18,240 --> 00:02:25,199 disk and NVMe0 and 1 is my NVMe disk, which is a specific kind of SSD. 31 00:02:25,199 --> 00:02:27,119 And on my NVMe, I have partitions. 32 00:02:27,119 --> 00:02:30,000 We'll talk more about partitions later. 33 00:02:30,000 --> 00:02:33,199 lsblk identifies what is going on. 34 00:02:33,199 --> 00:02:38,520 lscpu is for listing CPUs and their properties. 35 00:02:38,520 --> 00:02:42,660 Now I am on ARM, Apple Silicon to be precise. 36 00:02:42,660 --> 00:02:46,759 And Apple Silicon does not reveal a lot of information. 37 00:02:46,759 --> 00:02:51,279 If you're on Intel-based, you'll see much more information, like the clock speed, the 38 00:02:51,279 --> 00:02:54,119 type of processor, and so much more. 39 00:02:54,119 --> 00:03:00,360 But lscpu is an awesome way to find out what exactly your CPUs are doing. 40 00:03:00,360 --> 00:03:02,479 And finally, there is dmessage. 41 00:03:02,479 --> 00:03:05,320 Dmessage is not really about listing devices. 42 00:03:05,320 --> 00:03:09,199 It's about showing the kernel or ring buffer, as we call it. 43 00:03:09,199 --> 00:03:13,940 And in the kernel or ring buffer, messages are written that are related to what's going 44 00:03:13,940 --> 00:03:15,660 on on your kernel. 45 00:03:15,660 --> 00:03:20,979 So you can find device-related information, like right here, E1000. 46 00:03:20,979 --> 00:03:27,860 Well, E1000, that happens to be my Ethernet controller, which is on the PCI bus. 47 00:03:27,860 --> 00:03:30,899 So this relates to lspci. 48 00:03:30,899 --> 00:03:37,740 And we can find more information, particularly about drivers and other kernel-level stuff 49 00:03:37,740 --> 00:03:40,380 going on by using the dmessage utility.