Finding system information from the command line
Other System Hardware Information
Outside of hard drives and processor chips, the basic command for hardware devices is lspci. As you might guess from the name, the command lists the PCI buses that are installed on the system. If you want to know what wireless card your laptop is using, so you can find a driver, or which video card you have, so you can look up information about it, then lspci is the command for you.
The first thing you need to know is that lspci displays information at three levels of detail – or verbosity. To get the least detail, enter only lspci (Figure 9). To get the next level of detail, type lspci -v, and for the most detail, use lspci -vv.
The next thing you need to know is that, even at the lowest level of detail, lspci produces more information than even a full-screen virtual terminal can display all at once. Therefore, you will want to pipe the command through less or more so that you can scroll up and down as needed: lspci | less or lspci | more. If you know information about the device you are looking for, such as its bus or slot, you can filter lspci's output, but in many cases, that is exactly the information you are trying to find, so this filtering is usually of limited use.
The lspci command also comes with a number of useful switches that provide even more information. For instance, -nn shows the numerical and English names of each device, whereas -k shows the kernel modules associated with the device. No matter what options you use, lspci gives so much information that only stone cold hardware gurus will understand it all, but if you use the right switches and take your time, you can usually find the information that you need.
An Alternative
These commands are not the only ones that give you information about your system – they're just the most basic. Other commands give at least part of the same information as those listed here; for example, you could use dnsdomainname to find the machine name instead of uname. However, the commands here are the most multipurpose and should give you most of the information you likely want or need.
However, one alternative is comprehensive enough to be worth mentioning. If you need information that these commands don't provide, or if you are curious about an alternative, you can also try looking at /proc, which is the pseudo-filesystem generated during bootup that contains information from the kernel. Ordinarily, the /proc directory is something that you should never meddle with, especially when logged in as root, because one wrong move could bring your system down. However, as long as you confine yourself to basic viewing commands like cat or more, you cannot damage it.
If you change to /proc and enter the ls command, you will find that the directory comprises a number of folders and files. If you view the files, you will see a variety of information about your system and how it operates. For instance, cat ./version gives information about the version of the kernel and the distribution you are using, whereas cat ./cpuinfo gives detailed information about the chipset in your system. Even if you can't guess what sort of information each file contains by its name, viewing is still harmless.
The advantage of reading from /proc is that you have fewer commands to remember. The disadvantage is that the information is not organized systematically from the human perspective.
However, between the traditional commands and /proc, you should find all the information you will ever need about your software and hardware and – as often as not – much more. Both are ways of using the command line to obtain information that is simply unavailable from the desktop.
« Previous 1 2
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
-
DebConf24 to be Held in South Korea
Busan will be the location of the latest DebConf running July 28 through August 4
-
Fedora Unleashes Atomic Desktops
Fedora has combined its solid distribution with rpm-ostree system to make it possible to deliver a new family of Fedora spins, called Fedora Atomic Desktops.
-
Bootloader Vulnerability Affects Nearly All Linux Distributions
The developers of shim have released a version to fix numerous security flaws, including one that could enable remote control execution of malicious code under certain circumstances.