Show Your USB Devices In The Linux Terminal

Today’s article won’t be all that long or complicated because we’re just going to show your USB devices in the Linux terminal. This is something easily done and not something too unusual. You never know when you’ll want to show your USB devices, but this is your chance to do so.

We have covered the lsusb command in the past, but we’ll include that and go beyond that. Why? Because we can. It’s okay to revisit earlier material if we’re going to add to it.

USB stands for Universal Serial Bus and there are many versions. I’d like to think that my readers don’t need to be told what USB is. You’ve probably used USB devices in the past, including using a USB storage device to install Linux or use as an input device like your keyboard and mouse. 

Not having to explain that will save a lot of time!

Show Your USB Devices:

You can learn quite a bit about your USB devices in the terminal. You can learn what the devices are, maybe the product name, where it’s plugged in, and more. So, we’ll cover that in this article.

The two tools we’re going to use shouldn’t require any new software. Sweet!

lsusb:

The first tool we’ll cover is the lsusb application. You won’t need to install this. It will be installed by default. You can confirm that you have lsusb installed with the following command:

Sure enough, you can check the man page to see that this is a good tool for this task. That command is:

With that information, you can see that it’s described like this:

lsusb – list USB devices

See? It’s exactly the tool for the job!

To run this command, you simply run it in your terminal – like so:

That will output a bunch of USB information.

usb-devices:

Now this is a command that I’ve not previously covered. It’s a simple command to operate but the output is different from the above. This command gives a great deal more information than the above lsusb command does. 

You can ensure that usb-devices is installed with this command:

If you want to check the man page, run this command:

You’ll see that this is a useful tool if you want to show USB devices. In fact, you’ll see that it’s possibly better than the plain lsusb command. It’s described like:

usb-devices – print USB device details

The important part is ‘details’. This command will show you a great deal of the details regarding the USB devices.

NOTE: This will only show the details for things that are active. If you have inactive USB devices it will not show them. That explains the difference between the lsusb command and the usb-devices command. Well, that and this command spits out a lot more information.

If you want to run this command in your terminal, it’s simply done like so:

That’s not very complicated at all and will reveal quite a bit more information than you’d get with the previous lsusb command. It’s worth running both in some situations, but run this usb-devices command if you need detailed information.

Closure:

See? I told you that this one wouldn’t take all that long. I probably could have labeled this one as a short article, but I didn’t. It’s also written in a different format – not even telling you how to open your terminal. If you need to know that, you can figure it out – or you already know. I did mention the terminal in the headline.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

View Disk Usage

This article might seem like it has been written before but this is an entirely new way to view disk usage. To write this article I had to write two other articles. Tell me that that doesn’t sound like fun!

So, let’s see here… And, yes, I’m aware that they’re not disks anymore.

Yup. It’s official. There are too many ways to view disk usage in Linux – especially in the terminal. Why am I writing yet another article on the subject of disk usage? Because I can! I love showing how there are many ways to do the same thing in Linux. This is great because you can pick and use your favorite methods.

As for the subject of monitoring disk usage…

Monitor Disk Usage With GDU
Show Disk Usage With ‘ncdu’
A Few Ways To Visualize Disk Usage In Linux
How To: Check Disk Usage With ‘df’
Yet Another Way To Check Filesystem Space Use

Those are just the first five links when I searched for ‘disk usage’. That’s just five ways to check disk usage in Linux. I’m willing to bet that we can easily come up with five more ways to do this.

What’s special about this way of viewing disk usage?

Well, today we’ll be monitoring your drive space with a tool written in Python. You’ll need to enable PIP, a Python packaging tool. Once you’ve done that, this is universal. It will work in any distro that supports PIP – which, as you’ll see, is just about every major distro on the planet.

Read the following before going further:

Install Python’s PIP Part One
Install Python’s PIP Part Two

If you haven’t already installed Python’s PIP, this article will be of no use to you. You’ll need PIP enabled to proceed. You should also add the $PATH as defined in the second article. From here on out, the article will assume you’ve done both of those things.

View Disk Usage With Vizex:

The tool we’ll be using is known as Vizex. You can see the Vizex project page here. If you bother going there, you’ll see that Vizex is indeed the correct tool for the job. You’ll see that this is (one of the many) correct tools for the job.

vizex is the terminal program for the UNIX/Linux systems which helps the user to visualize the disk space usage for every partition and media on the user’s machine. vizex is highly customizable and can fit any user’s taste and preferences.

Hmm… It is at this point that I noticed that they don’t capitalize it. I’m going to capitalize it because it’s keeping the system from saying I didn’t spell it properly. 

Anyhow, as you’re using PIP, you’ll need an open terminal. You can use your GUI to open your terminal. On many systems, just press CTRL + ALT + T and your default terminal will open.

To install Vizex, run the following command:

If you’ve never installed a Python package with PIP before, then be sure to keep an eye on the screen. It’s a fascinating process and watching stuff happen in the terminal is pretty sweet!

Now that you have Vizex installed, you simply run that command in the terminal. If you didn’t follow the 2nd part of the Python PIP article you’ll have to specify the path. That’s just silly. Follow the 2nd article (it’s really easy) and you don’t have to deal with that. 

Using Vizex:

Anyhow, that command is simply:

It will even color-code your drives. If they’re close to full, they’ll be red and blink (missed in the screenshot below). If you’re moderately full, they’ll be listed in the yellow. I wanted to use Vizex to view a computer will all sorts of drives, so I did! That’s how you ended up with this screenshot:

using vizex to view disk usage
If this isn’t self-explanatory, I don’t know what is! It’s so simple that I can figure it out!

If that isn’t one of the easiest ways to view disk usage, I don’t know what is. This is just one of the many reasons why you should have Python’s PIP installed. There’s a bunch of software that’s available if you just know where to look. It took a while, but I finally got around to sharing this information. In my defense, it did take a couple of articles to share it properly.

Closure:

There are all sorts of ways to view disk usage. This is just another way, though it’s an interesting way. I’m quite sure that I’ll cover this very same subject again in another article. For now, I’ve covered a way to do so with Python and that’s something different than you’ve previously seen on the site.

I may not place ads on the site and just opt to accept sponsored articles as a way to cover the bills. That seems like a good thing to do. Some stuff may already be in the works, so look for that in the future. If you’re interested in sponsoring an article, be sure to hit me up. We get good traffic and rank well in the search engines. So, get some extra traffic and some SEO benefits by sponsoring an article!

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Test Your Storage Drive’s Read Speed

One of the most frequent things you’ll do is read data from disk, so why not test your storage drive’s read speed? In this article, we’ll use an application we’ve used before. This shouldn’t be a very complicated article.

We store data on drives, or disks if you prefer. Most of us don’t use disks as our main storage devices. We do use disks for backups or storing large amounts of data, but we largely use SSDs these days. Some of us even use NVMe M.2 SSDs to store our data. The latter is currently the quickest you’re likely to encounter as a consumer.

The old spinning platters we used (though we’ve used lots of forms of magnetic storage) are typically referred to as HDDs (Hard Disk Drives). The SSDs (Solid State Drives) have no moving parts and are much faster. The NVMe M.2 SSDs are faster still.

If you’re suffering from some bottleneck, you might want to diagnose that. You might just be curious. It is also possible that you just purchased new hardware and want to see if the storage device reaches the advertised speed.

The tool we’ll be using is hdparm. This works fine with USB thumb drives, HDDs, regular SSDs, and even NVMe SSDs. It’s a complex application with a lot of options. I’ve covered some features before.

How To: Show Your Hard Drive Specifications In The Terminal

So then, let’s learn about this hdparm…

hdparm:

It should be noted that this hdparm application should be installed by default. It should also be mentioned that hdparm is a terminal-based application. You can verify that hdparm is installed with the following command:

If you then check the man page (with man hdparm) you’ll see that hdparm is described quite nicely like this:

hdparm – get/set SATA/IDE device parameters

If hdparm is not installed, you can surely find it in your package manager. 

As you can see, hdparm is the right tool for the job assuming you want to test your storage drive’s read speed. It’s also the right tool for a bunch of other jobs, but we’ll just be covering the read speed today.

Test Your Storage Drive’s Read Speed:

As I mentioned above, this hdparm application is something you use in your terminal. I suspect my regular readers will have guessed that. If you’re new to the terminal, more often than not you can open your default terminal by pressing CTRL + ALT + T.

With your terminal open, let’s identify your storage drives with this command:

You’re interested in the bits that start with /dev/<drive_ID> as those are the drives you’ll be able to test. 

NOTE: You should run these tests several times and average them, and you should do so while the system is otherwise idle. That will give you the peak results.

We’re interested in two flags, as they represent two tests. The -t flag tests the read cached. The -T flag tests the drive’s buffered read timings. You’ll often find the first test is fairly similar throughout the different drives and that the cached test shows the most differences. If those two terms, cached and buffered, confuse you, here’s a link about the differences between cache and buffer as far as the hdparm application goes.

You’ll need elevated permissions for this, so the command looks like this:

Or, as an example for many of you, the command might look like this:

That command will test both the cached read speed and the buffered read speed. These tests are important because you’re using a smart operating system that puts things into the cache and buffer that are likely to be read from the drive. So, the command listed will test both. You can split them up of course.

I decided to get you some examples:

Some Quick Read Speed Tests:

This is the internal SSD on a desktop:

Next is a USB 2.0 device plugged into that desktop:

Then we have an external HDD plugged into a USB 2.0 port on that desktop:

For comparison, this is an NVMe M.2 SSD:

As you can see, the internal SSD is quite fast. The thumb drive is the next quickest. This is followed by the external drive that’s just a spinning platter drive. 

Then, of course, you can see that the NVMe M.2 SSD is so much faster. That’s not even the fastest SSD out there. There are faster NVMe M.2 SSDs that don’t cost a lot of money. The prices have come down these days. You can even get a PCIe card that lets you mount an NVMe M.2 SSD if your motherboard doesn’t already support it.

Closure:

Should you want to get some drive benchmarks, you can certainly use hdparm to test your storage drive’s read speed. This isn’t something complicated and most anyone can figure it out. All you need to do is follow the directions carefully and in order. I do try to explain things as I go along.

There’s a lot more to the hdparm application. I encourage you to check the man page. There are probably another half-dozen articles that can be written about hdparm, so you’ll likely see this application again in the future. I doubt I’ll do another one too soon, as I like to space things out and not get too repetitive. 

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Yet Another Way To Check Filesystem Space Use

Many tools do the same thing in Linux and this is just another way to check filesystem space use. This one isn’t all that special, it’s just another way. If you want to check your filesystem usage (basically, how much free space you have used on your storage devices) this article can help you with that.

This shouldn’t be a long article. I’ve written others on the topic. It’s safe to assume that you know what a filesystem is. It’s the system your hardware uses to store data if you don’t know. There are many types, from Ext3 to ExFAT. They are all filesystems used to store data.

It should go without saying that you can fill up your storage space and might want to know how much space you have available. Well, if you want to find that information, this is an article for you!

This is another application. There are others.

Monitor Disk Usage With GDU
Show Disk Usage With ‘ncdu’
How To: Check Disk Usage With ‘df’

Those are just a few applications that will let you monitor your filesystem’s usage. I’m sure I’ve covered others.

This pydf is a Python script, but we’ll be using Lubunt and installing pydf just like we’d install any other application, albeit in the terminal. I will point out that pydf has a colored output, which is nice.

I can’t say that this pydf is available in other distros, but it’s available in Lubuntu. As Lubuntu is Ubuntu, that means it’s available in Ubuntu. It is also likely available in Debian. I think you’ll find that pydf is also available in the downstream distros like Linux Mint. I did provide a link above that will take you to the project page.

Check Filesystem Space Usage:

As I’ve done the work in Lubuntu, these directions will be for Lubuntu. You can adapt them easily. In Lubuntu, you can open the terminal by pressing CTRL + ALT + T on your keyboard. That will open the default terminal.

With your terminal now open, you can install pydf with the following command:

If you want to check the man page (say with man pydf), you’ll find that there isn’t one. If you’d like to view the pydf’s help file, try this command:

Once you’ve done that, you’ll see that using pydf is quite simple. If you just want to run the program to check filesystem space use, then just run it in the terminal like so:

If you want the output in ‘human-readable’ format, you can add a -h flag where bits are divided by 1024, or -H which means bits are divided by 1000. The choice is up to you.

Likewise, if you want to see even the zero-byte filesystems (the special filesystems that you don’t work directly with), you’d run this command:

Additionally, there’s a -l flag that limits the output to just the local filesystems. If I combine them for my preferred output, I get this:

Here’s an example output:

As you can see, there are a bunch of loop devices which are Snaps, which is perfectly normal for many Ubuntu-based systems. You can also see that I’ve used slightly more than half of my drive space and clever observers would notice that the drive is an NVMe SSD.

Closure:

So, that was a quick and easy article about how you can check filesystem space use, specifically in Lubuntu but easily applied to other distros. There are many ways to accomplish this task in Linux, which means this is just one among many such tools. It shouldn’t take too long to learn how to use pydf if that’s the tool you want to use.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Get Your NVMe SSD Information

If you’re using a modern computer, you might be using an NVMe SSD and you might want to know your NVMe information. The standard and older tools may not be all that helpful, even though NVMe SSDs have been around for a while. This article will help you with that, should you want to get your NVMe SSD information.

Let me see if I can explain this…

You’ll often see “NVMe M.2 SSD”, which is a mouthful.

NVMe stands for Non-Volatile Memory Express which is just a specification.

M.2 is another specification for expansion cards.

The device that is used for NVMe is an SSD – Solid State Drive.

SSD, which has been around for quite a while now, differs from previous generations of storage in that it’s electronic and not magnetic. 

We humans have a long history of trying to record things. We’ve used everything from words to pictures, from dots on paper to grooves on wire, from symbols to magnetic, and more…

For computers, a long time was in the magnetic storage age. From spinning drums holding mere bytes of data to complicated spinning platters that hold terabytes of data… We’ve made good use of the magnetic storage mediums over the years.

Solid-state drives don’t use magnets. Data is stored on memory chips that retain their memory (non-volatile) even if the power is disconnected. An SSD is quite common today.

Less common, but growing in popularity, is the NVMe M.2 SSD. This is a much smaller format than the early SSDs (which even came in the 3.5″ format, and surely some obscure formats that I’m overlooking). This is also on a faster bus lane, meaning the read and write speeds far exceed the storage medium before it – including the aforementioned larger SSDs that connect via IDE or (preferably) SATA.

The current consumer options are pretty great and an NVMe SSD is much faster than a regular SSD. The standard SATA SSD is quite common still, while the NVMe M.2 SSD is the latest and greatest.

With me so far?

Well, an NVMe M.2 SSD is a very different architecture and, as such, there are special tools to use. If you want to find the temperature of your NVMe SSD, the normal tools (like hdparm) may not yet work. Instead, there are other tools that you’d want to use.

In this article, we’ll be talking about a tool known as ‘nvme-cli’…

About nvme-cli:

You almost certainly don’t have nvme-cli installed by default. If you did, you’d be able to check the man page. Doing so would show that nvme-cli is described like this:

nvme – the NVMe storage command line interface utility (nvme-cli)

It should be important to know (and we’ll get to the installation step in just a minute) that you’ll be installing the package with one name but referring to, that is using, the application with another name.

For example, it’s man nvme to access the man page. 

NOTE: You will want to read the man page. There’s a whole lot of options and we’re just going to cover one basic command. We’ll learn stuff like the operating temperature of your NVMe. We won’t be worried about the various other options, of which there are many.

Find Your NVMe Information:

If you want to find your NVMe information in the terminal, you can do that. You’ll first need to install a tool known as nvme-cli. To do this, you’ll want an open terminal. You can usually open a terminal by just pressing CTRL + ALT + T. 

With your terminal now open, you must first install nvme-cli. You’ll find that packages are available for many distros, as they should be as the format is becoming more and more popular. 

Follow one of the basic installation methods below, specifically the one suitable for your distro’s package management system.

Debian/Ubuntu/etc:

SUSE/OpenSUSE/etc:

Fedora/Asahi/etc:

RHEL/CentOS/etc (those with yum available still):

Arch/Manjaro/etc:

I’m pretty sure there’s an nvme-cli package available for all the major Linux distros. If not, I linked to the project page above and you can check there for a package or to compile nvme-cli from source.

Find Your NVMe’s Absolute Path:

You’re going to need the absolute path to where your drive is mounted. That’s a part of the command, so you’ll need that. Just to mix things up a little bit, we’ll use the ‘df’ command. You should have df installed automatically on any major distro. The man page will helpfully describe the df application like so:

df – report file system disk space usage

We don’t care about all that. We just care about the absolute path. This usually starts with /dev/ and ends with the device ID. In an NVMe’s case, it will usually include nvme in the title, which is quite helpful.

So, let’s get that information…

You’ll get an output similar to this one:

It should be obvious that the absolute path for this would be /dev/nvme0n1p1 and that’s the data we’re going to need.

Now, to find your NVMe information, the syntax would be like so:

Using the output from above, an example of that would be:

This will then give you an output like so:

nvme status in the terminanl
There you go, you now have your NVMe Information. It’s not too difficult to do.

Of course, you can pipe this output to other commands. Let’s say you wanted to know the current temperature of your NVMe SSD. You’d do that with the grep command. An example would be:

If you want to know the number of times you’ve powered the device on, you can do that by piping the output to grep again. For example:

So, you can use the nvme-cli application (the nvme command) for quite a bit. You can do a whole lot more with it, so be sure to check the man page if you’re interested in doing more than checking the temperature or how many times you’ve cycled the power on that device.

As NVMe SSDs get more common, you’ll likely start seeing this package installed by default. From what I can see right now, no major distro is including this by default. If you’re using an NVMe M.2 SSD, you might just want to install it. If nothing else, it’s yet another tool that might come in handy.

Closure:

Today’s article is a bit longer than some but I think it’s worth reading. If I didn’t think it was worth reading, I wouldn’t have written as much! There’s so much that I could have covered but I didn’t. Articles have to have only so many words before people lose interest.

I’d have loved to cover the history of computer memory (or perhaps even more about how we humans have recorded stuff) but that didn’t seem prudent. I figured I’d limit the number of words to 1,200, but I still managed to exceed that – though not by too many. Seriously, it’s a pretty fascinating bit of history. You should use Google (and/or YouTube) to see learn about all the different ways we’ve stored data, and that’s just scratching the surface!

Fascinating stuff, I tell you! Fascinating!

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.