8 ms·
Linux commands for advanced hardware and system info
- rkwasny 4y agoHi, small fix: $ hdparm -tT /dev/sdN - partition reading & writing benchmark It will just benchmark reading, not writing, perfectly safe to run it on a disk with data.
- shmerl 4y agoFor lsusb and lspci you might need sudo for more detailed output.
- ssd8991 4y ago[flagged]
- traceroute66 4y agoI have to say the title is a bit clickbaity. Since when were uname,dmesg,fdisk,gdisk,parted,blkid,lsblk,mount,df and /proc "advanced" commands ? A newbie will likely need to use all of them within the first week of them ever using Linux.
- hutzlibu 4y ago"A newbie will likely need to use all of them within the first week of them ever using Linux." And then some people wonder, why the year of the linux desktop still has not arrived. But luckily no, unless things went very wrong, a newbie will not have to invoke those commands - and if he indeed has to, he or she will likely just give up anyway. (Btw. I use linux since years and so far only had to use half of the listed commands.)
- krylon 4y agoI concur. I've been using GNU/Linux on the desktop (and server) for 20 years, I don't think I ever used blkid or lsblk. fdisk, on the other hand, was a thing in the DOS/Windows world, too, back in the day, and dealing with partitioning is something you are going to do regardless of the OS you are using.
- mbiondi 4y agolsblk is super helpful and I've used it many, many times since I found it about 5 years ago. inxi is a new one for me. Command usage / knowledge depends on what you need and why.
- krylon 4y ago> inxi is a new one for me. For me, too. I was surprised to find it already installed on my system. :)
- yjftsjthsd-h 4y ago> I concur. I've been using GNU/Linux on the desktop (and server) for 20 years, I don't think I ever used blkid or lsblk. How do you write disk images (like, if you're installing a new machine and you need to write the installer to a USB drive)? I always use lsblk to find the right device name, then dd to write it.
- krylon 4y agoI use dd, too. But I usually know what device corresponds to the USB drive. If my laptop only has one HDD/SSD, it's /dev/sda, so a USB drive will show up as /dev/sdb. My desktop has two internal SSDs, sda and sdb, so the USB drive is going to be sdc.
- justsomehnguy 4y ago> (like, if you're installing a new machine and you need to write the installer to a USB drive I just make sure I point at the right device letter. For all it worth in the last 10 years I never need to bother with it, because in the worst case I write the installer in Windows environment and when I install it on the machine (be it a hardware or a virtual machine) it doesn't matter.
- hnlmorg 4y agoThe DOS fdisk was a very different beast to its Linux/UNIX counterpart.
- cal85 4y agoYou’re already advanced then. Your claim about “within the first week” is a bit silly. I’ve used Linux on and off for the last 15-20 years. Just occasionally, to get certain things done in my development work. And I couldn’t tell you what any of those commands do (although I’ve probably used them a few times by copying and pasting). Advanced is subjective.
- A4ET8a8uTh0 4y agoI think I disagree. I stumbled on lspci specifically, because I built my new PC with dual gpu ( to use real gpu in VMs ). I do not consider myself an advanced user ( maybe intermediate ). I basically agree with OP. Advanced does mean advanced. It does not mean using couple of simple commands picked from one google search. To me it means being able to think a little beyond the basics and putting things together. Advanced is subjective, but we should not water it down to basically a list of basic commands...
- jethro_tell 4y agoIt may be true that people don't need to use these commands in the first week. Still doesn't make them advanced. Perhaps intermediate but I think even that is a stretch. You can drive a car and never open the hood if you want. Opening the hood to change the oil still doesn't make you advanced in any way shape or form. Doing your own breaks is a step further but it's still pretty basic. Swapping your engine, is advanced, redoing your suspension is advanced. You can't just call using an oil pan and a wrench advanced because most people don't it.
- cal85 4y agoI’d settle for intermediate.
- bayindirh 4y agoI'm also using Linux for ~20 years, and used these commands periodically on my personal systems and at work daily. None of these commands are advanced. Yes, they might not be "very beginner level", but listing your partitions, PCI/USB/SCSI/FireWire devices, and learning other stuff about your system is not advanced level stuff. Most of these commands equals to right clicking something and opening "Properties" panel, nothing more. Parted is a partition editor though. You might wipe your system accidentally if you don't know what you're doing. The advanced stuff starts with interrupt tables, CPU frequency hysteresis settings, writing custom governors for cqufreqd or starting to isolate your services under cgroups for resource management. Edit: Just used lsblk & mount to see where a disk is and what filesystem it has, literally 3 minutes after writing this comment.
- rootlocus 4y agoI have interviewed "senior devops" candidates that didn't know what procfs was. edit: We didn't consider them for the role.
- metadat 4y agoHopefully they didn't get the green light..
- dijit 4y agoEither we have abstracted away the operating system so this is a non-issue or those candidates are simply not qualified. If you’re senior then I would definitely expect you to know those commands, if you’re senior you’ve been around long enough that they were relevant. Even if they’re not now.
- jotm 4y agoI know what it is, do I qualify for at least a junior position? :D
- pengaru 4y ago> I have interviewed "senior devops" candidates that didn't know what procfs was. We've all had our fair share of encountering dishonest interviewees/resumes.
- geekbird 4y agoActually, a lot of the people new to DevOps who come from the Dev side don't know the Linux internals. All they know is TF/CF, k8s, Docker and either AWS or GCP. If you asked them to set up a raid array they'd look at you like you just grew a second head. If you asked them how to tell what modules the kernel was running, they wouldn't be able to find out without a lot of googling. The fact that DevOps does encompass a lot of fundamental Linux system knowledge is glossed over by a lot of people. Then again, some of them don't know any other way to package and deploy software except in containers.
- mhh__ 4y agoIf you install Ubuntu or any other user friendly distro you might not ever use any of them. I know what they are, obviously, but I don't think I've needed any of them other than uname because I don't know where Ubuntu prints the kernel version.
- antisthenes 4y ago> If you install Ubuntu or any other user friendly distro you might not ever use any of them. Maybe if you install Ubuntu and then never use any program other than your browser to check email and whatever the built-in office suite is, and also never change any settings. But then again that type of user will never Google for "advanced Linux commands" in the first place. They're just going to ask the person who installed Ubuntu for them.
- worik 4y agoI've been using Linux since 1995. I had never heard of `inxi`. 21k lines of Perl, not Bash....
- synicalx 4y ago> 21k lines of Perl GLORIOUS $10 says this was made by someone who worked at an ISP.
- BrandoElFollito 4y agoSince everyone is mentioning experience, I have administered from 1 to a dozen linux servers since 1994. df, mount, dmesg are basic ones for someone who uses a command prompt. fdisk and friends are for the ones who added a disk after installation The rest is for those who had a problem and found a solution on askununtu.com or serverfault. Or are actually advanced. I think there is a big difference between the users who work on the command line and those with a GUI. I do not even know what GUIs are used, except that I heard the names gnome and kde. Troubleshooting those would be a real challenge for me as they are very complex software. Same for the sound. I recently had to attach a small loundspeaker to a rpi. Oh god, what an experience to make it make a sound. All this with nearly 30 years of Linux. So experience is very relative, you may know how to write an inode table from scratch and google basic stuff you do not use.
- mmh0000 4y agohdparm is an "okay" tool for a quick read speed benchmark, but if you really want to benchmark Linux storage, its hard to beat fio[0] [0] https://github.com/axboe/fio https://github.com/axboe/fio
- h2odragon 4y ago> lsscsi - print attacked SCSI devices into appropriate typo
- skered 4y agoDang. I thought I found that 8 hours later.
- rahen 4y agoThey should have mentioned udevadm too. How do they debug their udev rules without it? Overall a low quality article IMHO, it's just basic knowledge in a fancy dress.
- marcodiego 4y agoSomething I miss about IRIX: hwgfs. Nowadays, /sys mostly makes up for that, I like the fact that I mess with my leds from a simple filesystem, but it is nowhere near as tidy was IRIX' hwgfs was.
- emersion 4y agoFor display chips in GPUs, there is drm_info. For GL/Vulkan, eglinfo/glinfo/vulkaninfo.
- jandrese 4y agoglxinfo is also handy, especially if you aren't sure which driver the system is using.
- xpuente 4y agonumactl is missing there. Information about memory topology is quite important.
- zekrioca 4y agoIt is not available in some distributions and one needs to install it (e.g., on Ubuntu/Debian: # apt install numact).
- grandchild 4y ago`lstopo` is cool too for bigger servers
- snarfy 4y agoThe article picture almost had a Droste effect, almost. https://en.wikipedia.org/wiki/Droste_effect https://en.wikipedia.org/wiki/Droste_effect
- deathanatos 4y ago… and is really weird; who has have a picture of themselves, taken from behind, as a desktop background? I realize it's pointless splash art. Also do which articles wouldn't bother with pointless splash that has nothing to do with the article. Half the screens feature … macOS.
- jchristian- 4y ago> For Advanced Hardware and System Info This first command is literally `uname`, one of the most basic and known commands...
- gorgoiler 4y agoRoll up! Roll up! Decode your Intel model/"stepping" (model/version) into a precise SKU name here: https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/intel-family.h https://github.com/torvalds/linux/blob/master/arch/x86/inclu... No, I do not know why every single ICELAKE processor is commented as Sunny Cove.
- zokier 4y ago> No, I do not know why every single ICELAKE processor is commented as Sunny Cove. Wikipedia can clarify that for you: > Ice Lake is Intel's codename for the 10th generation Intel Core mobile and 3rd generation Xeon Scalable server processors based on the Sunny Cove microarchitecture https://en.wikipedia.org/wiki/Ice_Lake_(microprocessor) https://en.wikipedia.org/wiki/Ice_Lake_(microprocessor)
- gorgoiler 4y agoThanks. I figured Sunny Cove was a post-Ice-Lake iteration, but for some reason wasn't being listed by itself in the .h.
- nikisweeting 4y agoThere's a similar much longer list compiled here too: https://docs.monadical.com/s/system-monitoring-tools https://docs.monadical.com/s/system-monitoring-tools
- theden 4y agoThis one is much better!
- mark_unwin 4y agoHere's the device info script from Open-AudIT. Use sudo (or root, obviuously) to get the most data. https://github.com/Opmantek/open-audit/blob/master/other/audit_linux.sh https://github.com/Opmantek/open-audit/blob/master/other/aud... ./audit_linux.sh submit_online=n create_file=y debugging=3